false Posted November 20, 2009 Report Share Posted November 20, 2009 Nezinu kas notiek, bet jebkadā kodā rada eroru: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\xampp\htdocs\index.php on line 271 $viesi = mysql_num_rows(mysql_query("SELECT * FROM lietotaaji WHERE id = '0' and time >= ".$delays."")); Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\xampp\htdocs\index.php on line 252 $entity = mysql_fetch_array(mysql_query("SELECT * FROM lietotaaji WHERE id={$_SESSION['id']}"), MYSQL_ASSOC); Kāda vaina? Quote Link to comment Share on other sites More sharing options...
briedis Posted November 20, 2009 Report Share Posted November 20, 2009 uzraksti echo mysql_error(); iespējams, kaut kāda kļūda kvērijā.. Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted November 20, 2009 Report Share Posted November 20, 2009 Man šķiet, ka vajag vispirms mainīgajam mysql_query rezultātu piešķirt. $rezultats = mysql_query("SELECT * FROM lietotaaji WHERE id = '0' and time >= ".$delays) or die('Ajajaj! '. mysql_error()); $viesi = mysql_num_rows($rezultats); Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted November 20, 2009 Report Share Posted November 20, 2009 Tavā SQL kvērijā. Nemočkā visu vienā rindā - dari visu lēnām un mierīgi: $sql = "SELECT * FROM users"; $result = mysql_query($sql) or die(mysql_error()); //pie šīs rindiņas tev viss noteikti apstāsies, jo būs kļūda kvērijā while($user = mysql_fetch_assoc($result) { echo $user["id"]; } Vaina ir tur, ka tavs kvērijs ir ar kļūdām. mysql_query() atgriež FALSE, ja neizdodas izpildīt tavu padoto kvēriju. Uz to arī vajag pārbaudīt. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.