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?
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).

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.