Hi For some reason the delete function does not want to work..
What I have is a from field where you put in the ID no you want to delete, this must then delete the row in mysql.
Database name = db2
table = contacts
row = ino
Please not I wrote mypass, user just for here..I did not forget to write it. All this is on one page.
[HTML]
<form action="d4.php" method="post" name="example" id="delete">
<span class="style1 style4">Delete by ID No :</span>
<input type="text" name="delete" />
<br />
<input name="submit" type="submit" value="delete" />
</form>[/HTML]
[PHP] <?php
$con = mysql_connect(" localhost","myu ser","mypass") ;
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db ("mydb_-_db2", $con);
if($_POST['delete']){ $query = "DELETE FROM contacts WHERE ino='" . $_POST['delete'] . "'"; mysql_query($qu ery); }
mysql_close($co n);
?> [/PHP]
Kind Regards
Louwrens
What I have is a from field where you put in the ID no you want to delete, this must then delete the row in mysql.
Database name = db2
table = contacts
row = ino
Please not I wrote mypass, user just for here..I did not forget to write it. All this is on one page.
[HTML]
<form action="d4.php" method="post" name="example" id="delete">
<span class="style1 style4">Delete by ID No :</span>
<input type="text" name="delete" />
<br />
<input name="submit" type="submit" value="delete" />
</form>[/HTML]
[PHP] <?php
$con = mysql_connect(" localhost","myu ser","mypass") ;
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db ("mydb_-_db2", $con);
if($_POST['delete']){ $query = "DELETE FROM contacts WHERE ino='" . $_POST['delete'] . "'"; mysql_query($qu ery); }
mysql_close($co n);
?> [/PHP]
Kind Regards
Louwrens
Comment