السلام عليكم اخواني الكرام انا في عندي اخطاء في عملية Edit
في لوحة التحكم
سأريكم الكود !1
أولا كود العرض من قاعدة البيانات :
<?
include("../config.php");
$rowsPerPage = 7;
$pageNum = 1;
if(isset($_GET['page']))
{
$pageNum = $_GET['page'];
}
$offset = ($pageNum - 1) * $rowsPerPage;
$SQL_Select_catag=mysql_query("select * from catagory LIMIT $offset, $rowsPerPage");
echo '<center><a href="add_catagory.php">Add Catagory</a></center><br>';
echo '<table width="300" border="1" align="center" style="border: 1px dotted #000000" cellspacing="0" cellpadding="0" >';
while (list($Id,$cat_name)=mysql_fetch_array($SQL_Select_catag))
{
echo "<tr><td>";
echo $id;
echo "</td><td>";
echo $cat_name;
echo "</td><td>";
echo '<a href= "edit_cat.php?cat_IDno=';
echo $Id;
echo '">Edit</a>';
echo "</td><td>";
echo '<a href= "delete_cat.php?cat_IDno=';
echo $Id;
echo '">Delete</a>';
echo "</td></tr>";
}
echo "</table>";
echo '<center><a href="add_catagory.php">Add Catagory</a></center>';
echo "<center><br>";
$query = "SELECT COUNT(Id) AS numrows FROM catagory";
$result = mysql_query($query);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$numrowsy = $row['numrows'];
// how many pages we have when using paging?
$maxPage = ceil($numrowsy/$rowsPerPage);
$self = $_SERVER['PHP_SELF'];
// creating 'previous' and 'next' link
// plus 'first page' and 'last page' link
// print 'previous' link only if we're not
// on page one
if ($pageNum > 1)
{
$page = $pageNum - 1;
$prev = " <a href=\"$self?page=$page\">[Prev]</a> ";
}
else
{
$prev = ' [Prev] '; // we're on page one, don't enable 'previous' link
}
// print 'next' link only if we're not
// on the last page
if ($pageNum < $maxPage)
{
$page = $pageNum + 1;
$next = " <a href=\"$self?page=$page\">[Next]</a> ";
}
else
{
$next = ' [Next] '; // we're on the last page, don't enable 'next' link
}
// print the page navigation link
echo $first . $prev . " Showing page <strong>$pageNum</strong> of <strong>$maxPage</strong> pages " . $next . $last;
echo "</center>";
?>كود ملف Edit :
<?
include("../config.php");
if ($cat_new_name != null )
{
$sql_update_catag=mysql_query("update catagory set cat_name='$cat_new_name' where Id='$cat_IDno'");
if ($sql_update_catag == true)
{
echo "Updated Done";
}
else
{
echo "Not Done";
}
}
else
{
$SQL_Statment_catag=mysql_query("select * from catagory where Id=$cat_IDno");
$SQL_Arr_catag=mysql_fetch_array($SQL_Statment_catag);
?>
<form action="edit_cat.php" method="POST">
<center>
Catagory Name: <input type="text" name="cat_new_name" value="<? echo $SQL_Arr_catag[1]; ?>">
<br>
<input type="submit" value="Edit">
</center></form>
<?
}
?>هنا تظهر لي الرسالة
Updated Done علما انها لا تقوم بالتعديل على قاعدة البيانات
الإتصال بقاعدة البيانات سليم ومجرب
فما بعرف ما الخطا ؟؟؟؟؟ يا ريت الحل باقرب وقت ممكن
