The code below should be able to delete a row from table car
having ProNumber='$searchTerm'
and ProCode ='$searchTerm1'
but it is not.Any help will be much appreciated .
<?php
$searchTerm = trim($_GET['keyname']);
$searchTerm1 = trim($_GET['codename']);
//create a database connection
mysql_connect("localhost","root","") or die("Error:".mysql_error());
mysql_select_db("products");
//Delete the record
$updateQuery = "DELETE FROM car WHERE ProNumber = '$searchTerm' AND ProCode ='$searchTerm1'";
mysql_query($updateQuery) or die("Error: ".mysql_error());
?>
note that the table and columns are created and filled with the corespondent data.
Update :
The following part of the answer to this question is what solved it
Mysql vs Mysqli Functions
mysql_* functions are deprecated in PHP 5.5.0 you should use the mysqli_* functions to make sure your scripts works on newer PHP Versions.