954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to put Delete button PHP

How to put Delete button PHP? please help.. thanks

knarffrank
Newbie Poster
12 posts since Aug 2008
Reputation Points: 10
Solved Threads: 0
 

Do you know html ?

nav33n
Purple hazed!
Moderator
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
 

I know html i just want to know how can I delete multiple rows of mysql result using a button inside a php.

knarffrank
Newbie Poster
12 posts since Aug 2008
Reputation Points: 10
Solved Threads: 0
 
<form action="delete.php" method="post">
<input type="submit" value="Delete" />
</form>
<?php
//delete.php

mysql_query("DELETE * from exampletable");
?>
Demiloy
Light Poster
48 posts since Aug 2008
Reputation Points: 12
Solved Threads: 6
 

and code for button is:

<input name="delbutton" type="submit" >
//this shuld be inside of form tag..


And

if(isset($_POST['delbutton']))
{
//write your deletion queries...
}
Shanti C
Posting Virtuoso
1,642 posts since Jul 2008
Reputation Points: 137
Solved Threads: 162
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You