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/33348-solved-warning-mysql_fetch_array-supplied-argument-is-not-a-valid-mysql-result-reso/ Share on other sites More sharing options...
michaellunsford Posted January 8, 2007 Share Posted January 8, 2007 your mysql query is not returning any result. You can either try echo mysql_error() after the query, or make sure you're running a query (because I dont' see one in your code). Link to comment https://forums.phpfreaks.com/topic/33348-solved-warning-mysql_fetch_array-supplied-argument-is-not-a-valid-mysql-result-reso/#findComment-155836 Share on other sites More sharing options...
johnwayne77 Posted January 8, 2007 Author Share Posted January 8, 2007 I've solved itmy colleague had renamed some field names in the database, that's why it errored.thanks Link to comment https://forums.phpfreaks.com/topic/33348-solved-warning-mysql_fetch_array-supplied-argument-is-not-a-valid-mysql-result-reso/#findComment-155839 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.