$fetch_song = mysql_query("SELECT title FROM band_songs WHERE `id`='$id'");
while(list($title) = mysql_fetch_array($fetch_song)){
$fetch_download = mysql_query("SELECT SUM(count) AS sum FROM band_count WHERE `file`="'$title'_high.mp3" AND `file`="'$title'_low.mp3"");
$row2 = mysql_fetch_array($fetch_download);
$blah = $row2їsum];
echo $blah;
};
Doesn't work. $blah should equal 84... though it echos nothing.
Last edited by iamkoa on Wed Mar 02, 2005 6:44 pm, edited 1 time in total.
$fetch_song = mysql_query("SELECT title FROM band_songs WHERE `id`='$id'");
while(list($title) = mysql_fetch_array($fetch_song)){
$fetch_download = mysql_query("SELECT SUM(count) AS sum FROM band_count WHERE `file`="'$title'_high.mp3" AND `file`="'$title'_low.mp3"");
$row2 = mysql_fetch_array($fetch_download);
print_r($row2);
$blah = $row2їsum];
echo $blah;
};
$fetch_download = mysql_query("SELECT SUM(count) AS sum FROM band_count WHERE `file`="{$title}_high.mp3" OR `file`="{$title}_low.mp3"");
You are slipping in single quotes in the other query for the file names look like this