Still struggling with this... I can't figure out why my script is conflicting with global.php. Here is the block of code that's having problems (keep in mind, it works fine when global.php is NOT required in the header of the script):
Code:
$connect=mysql_connect();
$db=mysql_select_db("forum",$connect) or die("Couldn't select database");
$results=mysql_query("SELECT favorites FROM user WHERE userid = '$uid'",$db);
list($favs)=mysql_fetch_row($results);
if ($favs == "") {
Die("You don't have any items in your favorites folder");
}
$favarray = explode("," ,$favs);
$total = count($favarray) - 1;
$db2=mysql_select_db("data",$connect) or die("Couldn't select database");
for ($i = 0; $i <= $total; $i++) {
$lid = $favarray[$i];
$getfavs=mysql_query("SELECT * FROM items WHERE id = '$lid'",$db2);
$result=mysql_fetch_array($getfavs);
I get the "0 is not a mysql result index" error on that last line of that code, where it fetches an array from the database query. Anyone have an idea of what part of that code is conflicting with global.php? Thanks.
-Tom
P.S. I know the code is probably a bit sloppy... I'm new to PHP and MySQL, so I'm still learning. It does work by iteself though