Below is code which is supposed to delete one row from the table.. But deletes the LOT??
Saved as delete.php
<?php
include("./include/dbconnect.php
if($delete = "delete")
{
mysql_query("delete from front_page where $d_row");
print "Entry Deleted";
}
else
{
print "Entry is not deleted";
print "<br><br>";
echo mysql_error();
}
?>
There may be an obvious problem there .... However if there is not and is not easy to solve... There is a here is the form with which the action is posted from...
Saved as remove.php
$content = mysql_query("select * from front_page") or
die (mysql_error());
$num_rows = mysql_num_rows($content);
print "There are currently $num_rows news enteries";
while ($a_row = mysql_fetch_array($content))
{
?>
<form method=post action=delete.php name=delete>
<input type="hidden" value="<? echo $a_row[id] ?>" name="d_row">
<input type="submit" value="delete" name="delete"></form></td>
</tr>
<tr>
<td colspan="3" height="52" valign="top"><? echo $a_row[content] ?></td>
</tr>
<tr>
<td height="21" colspan="3" valign="top">Posted on: <? echo $a_row[date] ?></td>
</tr>
</table>
<?
}
else
{
mysql_error();
}
I know there is some table code in there as well... but I need that code in there to have any layout problems picked at by you GURUS over there...
Keep on goin lads...
Code from you peeps has allways been helpful. Just i never type it right... LOL
Thanks