Tag Archives: Deleting Data

Deleting Data from within the Database using PHP

You can delete data from the database using delete command within the mysql_query function. Example: <html> <head> <title>Deleting a Record from Database</title> </head> <body> <?php if(isset($_POST[‘delete’])) { $db_host = ‘localhost:3036’; $db_user = ‘root’; $db_pass = ‘rootpassword’; $db_conn = mysql_connect($db_host, $db_user, $db_pass); if(! $db_conn ) { die(‘Connection failed: ‘ . mysql_error()); } $stu_id = $_POST[‘stu_id’]; $db_sql = “DELETE from… Read More »