Delete Data from Database Table in Mysql using PHP

Delete Data from Database Table in Mysql using PHP:

<?php
$con = mysql_connect("localhost","root","root");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_select_db("db_name", $con);
mysql_query("DELETE FROM Persons WHERE LastName='Alex'");
                                                      mysql_close($con);
                                                      ?>

No comments:

Post a Comment