
28-07-2007, 23:24
|
|
|
|
חבר מתאריך: 14.03.07
הודעות: 13
|
|
|
[עזרה] מחיקת נתונים מהטבלה
עשיתי את הסקריפט הבא:
קוד PHP:
<html> <head> <title>main-host -> פאנל ניהול</title> </head> <body bgcolor="c0c0c0"> <?php require "connect.php"; $result = mysql_query("select * from updates"); $num_rows = mysql_num_rows($result); print "<table border=1 align=\"center\" width=\"600\">"; print "<caption align=\"center\"><h1>צפיה בעדכונים שנוספו</h1></br><h3>בטבלה יש $num_rows שורת</h3></caption>"; print "<tr><td align=\"center\">מחק</td><td align=\"center\">קישור לאשכול של העדכון בפורום</td><td align=\"center\">שם העדכון</td><td align=\"center\">אידי</td></tr>"; print "<form action=\"$PHP_SELF\" method=\"POST\">"; while($a_row = mysql_fetch_object($result)) { print "<tr>\n"; print "<td align=\"center\"><input type=\"checkbox\" name=\"$a_row->id\"></td><td align=\"center\"><a href=\"$a_row->forumlink\">$a_row->forumlink</a></td><td align=\"center\">$a_row->name</td><td align=\"center\">$a_row->id</td>"; print "</tr>\n"; } print "<input type=\"submit\" name=\"submit\" value=\"מחק\" size=\"30\">"; print "</form>"; print "</table>\n"; mysql_close($link); if ( [PHP]%4$s
POST['submit'])
{
if (isset( POST['$a_row->id']))
{
require "connect.php";
$id = $a_row->id;
$result = mysql_query("SELECT * FROM updates") or die("couldn't select");
$delete = mysql_query("DELETE FROM updates WHERE ID = $id, $link") or die("couldn't delete");
mysql_close($link);
}
}
?>
</body>
</html>
[/PHP]
הבעיה פה היא שזה לא מוחק את הנתונים שאני מסמן ב V את ה checkbox. משהו יוכל לעזור לי בזה?
|