sql - PHP delete function -


i have delete script on dashboard working before moving domains.

( not sure if relevant )

the code 'deletejob.php' below.

<?php error_reporting(0);  $host = 'localhost'; $port = 3306; $database = 'database'; $username = 'username'; $password = 'password';  $uid = $_post["id"];   // connect database     $dsn = "mysql:host=$host;port=$port;dbname=$database"; $db = new pdo($dsn, $username, $password); // connect  $query = "delete joblist id='$uid'"; // query thingy whatever called $statement = $db->prepare($query); $statement->execute(); while ($result = $statement->fetchobject()) {}  ?> 

the script functions if working , gives me alert
( id has been deleted. )

does have idea why script return false positive?

you must find row want delete, using select statement, this:

$stmt= $conn->query("select * users id='".$_request['ids']."'"); 

also have have following sent when click delete button or not delete @ all:

<input type="hidden" name="id" value="<?php echo $_request['ids'];?>"> 

after above:

$stmt= $conn->query("delete users id = '".$_request['id']."'"); 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -