jariyan
سه شنبه 21 تیر 1390, 19:22 عصر
با درود من
من یک لیست از اعضای سایتم دارم و در جدول نمایش داده می شه و کنار دکمه delete قرار دادم
و بعد وقتی دکمه delete می زنم می خوام اطلاعات همان شخص رو نشون داده و بعد پاک کنه البته فعلا مشخصات رو نشون ندادم فقط می خوام پاک کنه ولی هر کاری می کنم انجام نمی ده .
جدول اطلاعات
<?php
session_start();
$con = mysql_connect("localhost","test","12345");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("university", $con);
$result = mysql_query("SELECT * FROM members");
echo "<table class='ewTable'>
<tr class='ewTableHeader' >
<th> Number </th>
<th> Firstname </th>
<th>Lastname</th>
<th>Usarname</th>
<th>password</th>
<th>mail</th>
<th>Delete User</th>
</tr>";
$nRecCount = 0;
while($row = mysql_fetch_array($result))
{
$nRecCount++;
echo "<tr>";
echo "<td>" . $row['member_id'] . "</td>";
echo "<td>" . $row['firstname'] . "</td>";
echo "<td>" . $row['lastname'] . "</td>";
echo "<td>" . $row['username'] . "</td>";
echo "<td>" . $row['password'] . "</td>";
echo "<td>" . $row['mail'] . "</td>";
echo "<td><a href=dls.php?member_id=$row[member_id]>Hapus</a></td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
و delete
<?php
session_start();
$con = mysql_connect("localhost","test","12345","university");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
if (isset($_GET["member_id"])) {
$result = mysql_query("DELETE FROM members WHERE member_id='$_GET[member_id]'");
echo "nodelete";
exit;
} else {
//send them somewhere else
echo "nodelete";
exit;
}
mysql_close($con);
?>
بدون form
من یک لیست از اعضای سایتم دارم و در جدول نمایش داده می شه و کنار دکمه delete قرار دادم
و بعد وقتی دکمه delete می زنم می خوام اطلاعات همان شخص رو نشون داده و بعد پاک کنه البته فعلا مشخصات رو نشون ندادم فقط می خوام پاک کنه ولی هر کاری می کنم انجام نمی ده .
جدول اطلاعات
<?php
session_start();
$con = mysql_connect("localhost","test","12345");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("university", $con);
$result = mysql_query("SELECT * FROM members");
echo "<table class='ewTable'>
<tr class='ewTableHeader' >
<th> Number </th>
<th> Firstname </th>
<th>Lastname</th>
<th>Usarname</th>
<th>password</th>
<th>mail</th>
<th>Delete User</th>
</tr>";
$nRecCount = 0;
while($row = mysql_fetch_array($result))
{
$nRecCount++;
echo "<tr>";
echo "<td>" . $row['member_id'] . "</td>";
echo "<td>" . $row['firstname'] . "</td>";
echo "<td>" . $row['lastname'] . "</td>";
echo "<td>" . $row['username'] . "</td>";
echo "<td>" . $row['password'] . "</td>";
echo "<td>" . $row['mail'] . "</td>";
echo "<td><a href=dls.php?member_id=$row[member_id]>Hapus</a></td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
و delete
<?php
session_start();
$con = mysql_connect("localhost","test","12345","university");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
if (isset($_GET["member_id"])) {
$result = mysql_query("DELETE FROM members WHERE member_id='$_GET[member_id]'");
echo "nodelete";
exit;
} else {
//send them somewhere else
echo "nodelete";
exit;
}
mysql_close($con);
?>
بدون form