Page 1 of 1
Problem with mysql_query and it's returns
Posted: Fri Feb 06, 2004 2:18 pm
by dashifen
Code: Select all
$getGameName = mysql_query($gameNameSQL, $db);
$getPCs = mysql_query($PCSQL, $db);
$getNPCs = mysql_query($NPCSQL, $db);
$numPCs = mysql_num_rows($getPCs);
$numNPCs = mysql_num_rows($getNPCs);
$row = mysql_fetch_array($getGameName, MYSQL_ASSOC);
Can anyone tell my why the calls to mysql_num_rows and mysql_fetch_array are saying the the $getPCs, $getNPCs, and $getGameName variables are not a valid msyql result resource? The connection has been made and the correct database has been selected. The query variables are all correct and if I run the queries through phpMyAdmin on the database, they work as expected. But, whe I try to use them from the web, I'm not getting the results I expect.
Thanks,
-- Dave --
Posted: Fri Feb 06, 2004 2:28 pm
by Saethyr
could we see your sql String please? This maybe happening because it is not returning anything.
***EDIT***
Actually this looks like a game, could we see $PCSQL and $NPCSQL strings
Thanks
Posted: Fri Feb 06, 2004 2:38 pm
by dashifen
Saethyr wrote:could we see your sql String please? This maybe happening because it is not returning anything.
***EDIT***
Actually this looks like a game, could we see $PCSQL and $NPCSQL strings
Thanks
Damn it ... I'm dumb. Got it. I had a misspelling on the mysql_select_db() function and didn't ad a die() function after it so I couldn't tell that nothing had been selected.
-- Me --
Posted: Fri Feb 06, 2004 3:54 pm
by Saethyr
happens to everyone man.