Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   General Discussions (http://forums.winamp.com/forumdisplay.php?f=1)
-   -   php help? (http://forums.winamp.com/showthread.php?t=138189)

ctn|chrisw 7th June 2003 15:34

php help?
 
Im trying to make it so I can submit using the dosomething plugin for winamp, the current playing song, artist, and album that Im listening to. I got a script that submits the song and it works
PHP Code:

<?php
      
require_once('config.php');
      
mysql_connectlocalhostchrisw$password);
      
mysql_select_db(chrisw_at);
      
mysql_query("Update $table set artist = '".$_GET["artist"]."', title = '".$_GET["title"]."', album = '".$_GET["album"]."' WHERE name = '$_GET[name]'  ");
?>

but now im stumped to how to get it out of the db so that it will select from the where the name = song and will output it like
Artist: current artist's name
Title: Current song's title
Album: Current Album.
Does anyone have any idea cause Im stumped :\

fwgx 7th June 2003 15:45

$query = "SELECT * from $table WHERE name = $song";
$result = mysql_query($query);
$num = mysql_affected rows();

if ($num == 0) {
echo "Artist: $result[0]";
echo "Song: $result[1]";
echo "Album: $result[2]";

} else {
do something else
}

pma 9th June 2003 05:20

you can ger more help from phpbuilder.com

FesterHead 9th June 2003 08:03

This thread might help some.

ctn|chrisw 9th June 2003 09:36

I got it a day or two ago :) thanks
http://www.chrisw.us/np/w00t.php :D (b00n wrote the code for t3h bottom)


All times are GMT. The time now is 21:34.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.