samXR Posted May 25, 2009 Share Posted May 25, 2009 hey guys..need ya help here..i new to this php stuff..i can delete/update stuff from the from into the database..but it is only for a specific name..but what i want is to delete/update stuff for any given name...this are the codes...thanks...ur help will be greatly appreciated...cheers...:::::THIS IS MY FORM:::::<form action="delete.php" method="post">Name: <input type="text" name="name"/>Age: <input type="text" name="age" />Hp : <input type="text" name="handphone" />Email : <input type="text" name="email" />Admin : <input type="text" name="admin" /><input type='submit' name='remove' value='Delete' /></form></body></html>:::::THIS IS MY PHP CODES:::::<?php $con = mysql_connect("localhost","root","root");if (!$con){die('Could not connect: ' . mysql_error());}mysql_select_db("studentreg", $con);mysql_query ( "DELETE FROM particulars WHERE name='sam' ");echo "name deleted!!";mysql_close($con)?> Link to comment Share on other sites More sharing options...
jeffman Posted May 25, 2009 Share Posted May 25, 2009 if (!empty($_POST['name'])) { $name = $_POST['name']; $Q = "DELETE FROM $table WHERE name='$name' "; mysql_query ($Q);} Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.