johnwayne77 Posted January 8, 2007 Share Posted January 8, 2007 This is the code:[code]<?php// afiseaza inregistrarile din tabela Produse corespunzatoare categoriei selectate while($linie_p=mysql_fetch_array($rezultat_p,MYSQL_NUM)) { echo "<tr nowrap>"; echo "<td align='center' valign='middle'>"."<b>".$linie_p[0]."</b></td>"; for($i=1;$i<count($linie_p)-1;$i++) echo "<td align='left' valign='middle'>".$linie_p[$i]."</td>"; if ($linie_p[$i]<>"0") // valoarea default din baza de date echo "<td align='left' valign='middle'><a href='cos.php?id=".$linie_p[0]."&denumire=".$linie_p[2]."&pret=".$linie_p[4]."'><img src='".$linie_p[$i]."' border='0'></a></td>"; // afiseaza imaginea else echo "<td align='left' valign='middle'>fara imagine</td>"; echo "</tr>"; }?>[/code]This is the error:[b]Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\WebSites\anul_4_informatica_2006_2007\1081_borisov\catalog\index.php on line 149[/b]Line 149:[b]while($linie_p=mysql_fetch_array($rezultat_p,MYSQL_NUM))[/b]Yesterday it worked just fine, now I get this error.Do you have any ideas? Link to comment https://forums.phpfreaks.com/topic/33347-solved-warning-mysql_fetch_array-supplied-argument-is-not-a-valid-mysql-result-reso/ Share on other sites More sharing options...
Psycho Posted January 8, 2007 Share Posted January 8, 2007 Well, that most likely means there was an error in your query. You need to change your querry call (which you dn't show to something like this:[code]$rezultat_p = mysql_query($sql) or die ("The query:<br>:".$sql."<br>Created the following error:<br>".$sql)[/code] Link to comment https://forums.phpfreaks.com/topic/33347-solved-warning-mysql_fetch_array-supplied-argument-is-not-a-valid-mysql-result-reso/#findComment-155842 Share on other sites More sharing options...
johnwayne77 Posted January 8, 2007 Author Share Posted January 8, 2007 i've worked it outmy colleague modified some field names in the DB table.it's working now.thanks Link to comment https://forums.phpfreaks.com/topic/33347-solved-warning-mysql_fetch_array-supplied-argument-is-not-a-valid-mysql-result-reso/#findComment-155875 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.