0

pliz help ma have this code but it doesnt delete records ,am tuck what could be the problem,thanks

here is the code
<?php
require_once('Connections/Database.php');
mysql_select_db($database_Database, $Database) or die("Unable to select database");

$aa=$_POST;

$bb=$_POST;

mysql_query("DELETE FROM doctor WHERE dID='$aa'");


$checkresult=mysql_query($query) ;
if ($checkresult) echo 'delete query succeeded';
else echo 'delete query failed';

mysql_close();

?>

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by BzzBee
0

pliz help ma have this code but it doesnt delete records ,am tuck what could be the problem,thanks

here is the code
<?php
require_once('Connections/Database.php');
mysql_select_db($database_Database, $Database) or die("Unable to select database");

$aa=$_POST;

$bb=$_POST;

mysql_query("DELETE FROM doctor WHERE dID='$aa'");


$checkresult=mysql_query($query) ;
if ($checkresult) echo 'delete query succeeded';
else echo 'delete query failed';

mysql_close();

?>

why you are writing query like ..

mysql_query("DELETE FROM doctor WHERE dID='$aa'");
$checkresult=mysql_query($query) ;

delete

$checkresult=mysql_query($query) ;

or write like

$query="DELETE FROM doctor WHERE dID='$aa'";
$checkresult=mysql_query($query) ;

also check using echo where $aa contain any correct value or not??

0

pliz help ma have this code but it doesnt delete records ,am tuck what could be the problem,thanks

here is the code
<?php
require_once('Connections/Database.php');
mysql_select_db($database_Database, $Database) or die("Unable to select database");

$aa=$_POST;

$bb=$_POST;

$query="DELETE FROM doctor WHERE dID='$aa' ";


$checkresult=mysql_query($query) ;
if ($checkresult) echo 'delete query succeeded';
else echo 'delete query failed';

mysql_close();

?>

you are applying mysql_query function two times. See red line and apply it now

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.