Jump to content

[SOLVED] Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result reso


johnwayne77

Recommended Posts

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?
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]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.