homers Posted November 11, 2009 Report Share Posted November 11, 2009 (edited) 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 November 11, 2009 by homers Quote Link to comment Share on other sites More sharing options...
briedis Posted November 11, 2009 Report Share Posted November 11, 2009 Kur tādu kodu var atrast :)) mysql_fetch_array($results, MYSQL_ASSOC) manuprāt pietiek ar mysql_fetch_assoc($rez); Quote Link to comment Share on other sites More sharing options...
homers Posted November 11, 2009 Author Report Share Posted November 11, 2009 To kodu var dabūt iekš php.net .. Ieliekot tavu domāto kodu iznāk šads errors: Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\xampp\htdocs\index.php on line 188 Quote Link to comment Share on other sites More sharing options...
xPtv45z Posted November 11, 2009 Report Share Posted November 11, 2009 (edited) 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 November 11, 2009 by xPtv45z 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.