My first post here and I am asking for help. :-\
But this bug is killing me....
I have an array with bunch of text values in it ($songsalt). I know the contents of the array are intact because I can see them using the "print_r" function.
When I run the below code, I see the "songID" for the first value in the array (position "0"), but that's it. No matter what I do, the foreach loop doesn't seem to want to look through the rest of the values in the array.
Even if I get rid of the foreach loop, and pull anything out of the array manually, it still doesn't output the songID for anything but the array value at position "0".
I am really baffled by this. ??? Any help really would be appreciated. Thanks for reading.
(Note: The handle error code does not output an error.)
foreach ($songsalt AS $value)
{
$result = mysql_query("SELECT songtitle FROM songs WHERE songtitle='$value'")
or die(mysql_error());
if (!$result) {
// Handle error
echo 'Query failed. SQL: ', $sql, '<br />Error # ', mysql_errno(), ' Error msg: ', mysql_error();
exit;}
while ($row = mysql_fetch_array($result)) {
echo $row['songID'];
echo "<br>";
}
}