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();

?>

Recommended Answers

All 2 Replies

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??

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.