[PHP]<?php
$host="localhos t";
$username="user ";
$password="rmyp wd";
$db_name="mydb" ;
$tbl_name="arti cles";
$cmd=$_GET["cmd"];
$id=$_GET['id'];
$cid = mysql_connect($ host,$username, $password);
if (!$cid) { echo("ERROR: " . mysql_error() . "\n"); }
mysql_select_db ('db_name');
if($cmd=='del')
{
// mysql_query("DE LETE from $tbl_name WHERE id=$id ");
$sql=("DELETE from $tbl_name WHERE id='$id'");
mysql_query($sq l);
print $sql;
echo("User Deleted Successfully&cm d='none'");
exit();
}
?>
<html>
<head>
<title>Edit Lyrics</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<div align="center">
<table width="700" border="0">
<tr>
<td bgcolor="#0099C C"><p> </p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
<tr>
<td><table width="100%" border="0" align="center">
<tr>
<td width="18%" align="center" valign="top">&n bsp;</td>
<td width="64%" align="center" valign="top"><p align="left">&n bsp;<?
$SQL = " SELECT * FROM $tbl_name ";
$retid = mysql_db_query( $db_name, $SQL, $cid);
if (!$retid) { echo( mysql_error()); }
else {
echo ("<P><TABLE CELLPADDING=4>\ n");
while ($row = mysql_fetch_arr ay($retid)) {
$headline = $row["headline"];
$description = $row["descriptio n"];
$id = $row["id"];
echo ("<TR>");
echo ("<TD>$headline </TD>\n");
echo($cmd);
echo ("<TD><A HREF=\"manageed it.php?id=$id\" >Edit</A></TD>");
echo ("<TD><A HREF=\"delete.p hp?id=$id&cmd=d el\">Delete</A></TD>");
// echo ("<TD><A HREF=\"delete.p hp?&cmd=del&id\ ">Delete</A></TD>");
echo ("</TR>");
}
echo ("</TABLE>");
}
?>
</p>
<p>
</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
<td width="18%" align="center" valign="top">&n bsp;</td>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor="#0099C C"> </td>
</tr>
</table>
</div>
</body>
</html>[/PHP]
This is the message I get After executing the command
DELETE from articles WHERE id='69'User Deleted Successfully&cm d='none'
However The record still exists in the database I am using php 4.47 version on server
$host="localhos t";
$username="user ";
$password="rmyp wd";
$db_name="mydb" ;
$tbl_name="arti cles";
$cmd=$_GET["cmd"];
$id=$_GET['id'];
$cid = mysql_connect($ host,$username, $password);
if (!$cid) { echo("ERROR: " . mysql_error() . "\n"); }
mysql_select_db ('db_name');
if($cmd=='del')
{
// mysql_query("DE LETE from $tbl_name WHERE id=$id ");
$sql=("DELETE from $tbl_name WHERE id='$id'");
mysql_query($sq l);
print $sql;
echo("User Deleted Successfully&cm d='none'");
exit();
}
?>
<html>
<head>
<title>Edit Lyrics</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<div align="center">
<table width="700" border="0">
<tr>
<td bgcolor="#0099C C"><p> </p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
<tr>
<td><table width="100%" border="0" align="center">
<tr>
<td width="18%" align="center" valign="top">&n bsp;</td>
<td width="64%" align="center" valign="top"><p align="left">&n bsp;<?
$SQL = " SELECT * FROM $tbl_name ";
$retid = mysql_db_query( $db_name, $SQL, $cid);
if (!$retid) { echo( mysql_error()); }
else {
echo ("<P><TABLE CELLPADDING=4>\ n");
while ($row = mysql_fetch_arr ay($retid)) {
$headline = $row["headline"];
$description = $row["descriptio n"];
$id = $row["id"];
echo ("<TR>");
echo ("<TD>$headline </TD>\n");
echo($cmd);
echo ("<TD><A HREF=\"manageed it.php?id=$id\" >Edit</A></TD>");
echo ("<TD><A HREF=\"delete.p hp?id=$id&cmd=d el\">Delete</A></TD>");
// echo ("<TD><A HREF=\"delete.p hp?&cmd=del&id\ ">Delete</A></TD>");
echo ("</TR>");
}
echo ("</TABLE>");
}
?>
</p>
<p>
</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
<td width="18%" align="center" valign="top">&n bsp;</td>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor="#0099C C"> </td>
</tr>
</table>
</div>
</body>
</html>[/PHP]
This is the message I get After executing the command
DELETE from articles WHERE id='69'User Deleted Successfully&cm d='none'
However The record still exists in the database I am using php 4.47 version on server
Comment