Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource (http://www.go4expert.com/forums/warning-mysqlfetcharray-supplied-t23867/)

abosirage 14Nov2010 14:18

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
 
hi everybody
help me please
I have some php pages it's work perfect in local host but when I run it online I faceed the folowin problem
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in .../view.php on line 11

viewdb.php code:
Code:

<HTML>
<div align="center">
<table border="0" width="63%" id="table1">
<tr><td>
<?php
include ('config.php');
$result = mysql_query("SELECT * FROM personnel");
echo "<TABLE BORDER=2>";
echo"<TR><td align=center width=190><B>الاجـــــــراء</B><td align=center width=190><B>الاسم بالكامـــــل</B>
<td align=center width=220><B>العنــــــــوان</B></TR>";
while($myrow = mysql_fetch_array($result))
{
echo "<TR>
<td align=center width=190><a href=\"view.php?id=".$myrow['id']."\">عرض</a> ";
echo "<a href=\"delete.php?id=".$myrow['id']."\">حذف</a> ";
echo "<a href=\"edit.php?id=".$myrow['id']."\">تعديل</ a>";
echo "<td align=center width=190>".$myrow["firstname"]." ".$myrow["lastname"]."
</a><td align=center width=190>".$myrow["nick"];
}
echo "</TABLE>";
?>
</td></tr></table></div>
<p align="center"><b><font size="4"><a href="serch.php">بحـــث</a>&nbsp;&nbsp;
<a href="input.php">إدخال جديد</a></font></b></p>
<p>&nbsp;</p>
</HTML>

so when I click عرض in this line
<td align=center width=190><a href=\"view.php?id=".$myrow['id']."\">عرض</a> ";
I recive this error :
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in .../view.php on line 11

follwig view.php code:
Code:

<HTML>
<head>
<meta http-equiv="Content-Language" content="en-us">
</head>
<div align="center" dir="rtl">
<table border="0" width="65%" id="table1">
<tr><td><?php
include ('config.php');
mysql_select_db("umma_mydb");
$result = mysql_query("SELECT * FROM personnel WHERE id=$id");
$myrow = mysql_fetch_array($result);
echo "الاسم : ".$myrow["firstname"];
echo "<br>اللقب : ".$myrow["lastname"];
echo "<br>العنوان : ".$myrow["nick"];
echo "<br>البريد الالكتروني : ".$myrow["email"];
echo "<br>المرتب : ".$myrow["salary"];
?></td></tr></table>
<b><span lang="ar-sa"><a href="serch.php">بحــــث</a>&nbsp;&nbsp; <a href="viewdb.php">عودة للقائمة</a></span></b></p>
</div>
</HTML>

what to do with it


All times are GMT +5.5. The time now is 18:42.