Jump to content
php.lv forumi

mysql fetch array errors


homers

Recommended Posts

Errors:

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\xampp\htdocs\index.php on line 188

 

188 rinda:

while ($row = mysql_fetch_array($results, MYSQL_ASSOC)) {

 

Viss kods:

<?php
$k = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM komandas_turnira"),0);
$skaits = "8";
$s_rez = $skaits-$k;
$open = "o";
$results = mysql_query("SELECT id,nos,x FROM turniri WHERE status=".$open." ORDER BY id DESC");
while ($row = mysql_fetch_array($results, MYSQL_ASSOC)) {
printf("<img src='/style/icons/arrow_right.gif'> <a href=?p=cup&id=%s>%s Cup</a> [<font color=green>%s</font>/<font color=red>8</font>]<br/>", $row["id"], $row["nosaukums"], $e);
}
?>

Edited by homers
Link to comment
Share on other sites

Tad jau php.net arī varēji apskatīties, ko un kad atgriež mysql_query.

"For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset, mysql_query() returns a resource on success, or FALSE on error."

Edited by xPtv45z
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...