NameSilo

Mysql_fetch HELP

SpaceshipSpaceship
Watch
Impact
22
can anyone explain what is wrong with this web page?? it was working well and then this:



Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/ros/public_html/game_funcs.php on line 5

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/ros/public_html/game_config.php on line 38

Warning: Cannot modify header information - headers already sent by (output started at /home/ros/public_html/game_config.php:38) in /home/ros/public_html/game_html.php on line 144

Warning: Cannot modify header information - headers already sent by (output started at /home/ros/public_html/game_config.php:38) in /home/ros/public_html/game_html.php on line 145

Warning: Cannot modify header information - headers already sent by (output started at /home/ros/public_html/game_config.php:38) in /home/ros/public_html/game_html.php on line 146

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/ros/public_html/login.php on line 4

Warning: Cannot modify header information - headers already sent by (output started at /home/ros/public_html/game_config.php:38) in /home/ros/public_html/login.php on line 24
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
looks like it is trying to fetch a field that isn't in your table

fix this and it will correct the headers error as well
 
0
•••
jdk said:
looks like it is trying to fetch a field that isn't in your table

fix this and it will correct the headers error as well

couldn't have explained it better myself... it seems like the error is reporting either something missing in your table, or some value that's unexpected and can't be parsed properly by php. Check out the DB first and see wha's wrong.

Cheers
 
0
•••
to hide the first 2 errors put a @ in front of mysql_num_rows e.g.: @mysql_num_rows($variable); then the other errors are because you but the header(); function before a header tag.. You cannot do that..
 
0
•••
Why would you want to hide the errors/warnings when you can fix them?
 
0
•••
Because mysql_num_rows problem's could also depend on the server sometimes..
 
0
•••
Christopher Menzimer said:
Because mysql_num_rows problem's could also depend on the server sometimes..

well before you would get that error you wouldnt be able to connect in the first place :-P
 
0
•••
well he has to check if he supplied connection to the db.. or a wrong variable.
 
0
•••
this page has been running smoothly all the while!:(
 
Last edited:
0
•••
Christopher Menzimer said:
well he has to check if he supplied connection to the db.. or a wrong variable.

well hes connected correctly, because he would get a connection error, this is a problem with a query.

Post the code please and i will see what i can do :)


Actually this could be an error where your going to need to run a code like this:

PHP:
<?PHP
$dbHost = 'localhost';
$dbUser = 'username';
$dbPass = 'password';
$dbName = 'database';
$db=mysql_connect($dbHost,$dbUser,$dbPass);
  $dbTables=mysql_list_tables($dbName,$db);
  $dbTableNum=mysql_num_rows($dbTables);
  for($i=0;$i<$dbTableNum;$i++){
$table = mysql_tablename($dbTables,$i);

$sql = mysql_query("OPTIMIZE TABLE $table") OR DIE(mysql_error()); 

  }
?>
i say this because the table might have some errors, so optimize it and find out, there is features like this in phpmyadmin as well.
 
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
CatchedCatched
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomainEasy โ€” Payment Flexibility
DomDB
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back