Jump to content

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


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).
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.