dear friendsI have this question my following code work with local but it's not with on line server the
the pages code is attached
please have a look & tell me how to do with it
remember that code works OK on local host
|
Go4Expert Member
|
|
| 11Nov2010,12:51 | #1 |
dear friendsI have this question my following code work with local but it's not with on line server the the pages code is attached please have a look & tell me how to do with it remember that code works OK on local host |
|
Go4Expert Founder
|
![]() |
| 11Nov2010,12:54 | #2 |
|
What error does it give when run online.
|
|
Go4Expert Member
|
|
| 11Nov2010,14:50 | #3 |
|
dear shabbir
good day the error showing when I run it online is: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/umma/public_html/db/data/view.php on line 11 |
|
Go4Expert Founder
|
![]() |
| 11Nov2010,17:53 | #4 |
|
This means it is nothing to do with your online or offline issue but your code is not well coded to work.
What is the code you have on line 11 |
|
Go4Expert Member
|
|
| 11Nov2010,18:37 | #5 |
|
dear Shabbir
good day I attached text file for my pages code with my post anyhow the code in line 11 is: $myrow = mysql_fetch_array($result); |
|
Go4Expert Founder
|
![]() |
| 11Nov2010,19:19 | #6 |
|
Don't expect that someone will download your txt file. Split code into each files. Upload. test and tell you what could be the changes needed. Will you do the same for someone's query?
Coming back to your issue. You are having this query. $result = mysql_query("SELECT * FROM personnel WHERE id=$id"); $myrow = mysql_fetch_array($result); So I can sense that your query and id variables does not have the right values to return the right result set. |
|
Go4Expert Member
|
|
| 14Nov2010,11:34 | #7 |
|
dear Shabbir
my view.php code like this: Code:
<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> <a href="viewdb.php">عودة للقائمة</a></span></b></p>
</div>
</HTML>
and the page with $id value viewdb.php 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>
<a href="input.php">إدخال جديد</a></font></b></p>
<p> </p>
</HTML>
|
|
Go4Expert Founder
|
![]() |
| 14Nov2010,17:27 | #8 |
|
What does $id contain in SELECT * FROM personnel WHERE id=$id
|
|
Go4Expert Member
|
|
| 14Nov2010,18:06 | #9 |
|
dear Shabbir
thank you for your reply good day in my code $id contain (int) id for personnel record |
|
Go4Expert Member
|
|
| 14Nov2010,18:22 | #10 |
|
dear Shabbir
good day I would like to thank you very much for your time & help I inform you that my problem solved the missing was to identified $id the following line is missing in my code $id=(int)$_GET['id']; thank you very much |