Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Databases _ DELETE not working in database

Posted by: tudsy Sep 20 2017, 07:40 AM

Hi

I have solved error 1044. In my script, I have the following lines:


$sth = prepare('DELETE FROM subscribers WHERE emailaddress = :Email');

$sth -> bindValue(':Email', "%{$Email}%");
$sth -> execute();

When I execute the above there is no error but the record is still in the database!

Can anyone help?


Thanks.

Adrian :shades: Attached File  Unsubscribe.php ( 1.56k ) Number of downloads: 1586
Attached File  unsubscribe1.php ( 2.03k ) Number of downloads: 1606
Attached File  Sorrytoseeyougo.html ( 1.02k ) Number of downloads: 1580
Attached Image

Posted by: tudsy Sep 21 2017, 01:14 AM

Hi

It works now!!!

I removed the quotes and % sign when I am binding the value.

Thanks.

Posted by: CharlesEF Sep 21 2017, 11:40 AM

The curly braces({}) are fine but I have no idea what the percent sign (%) is or even if it applies to PHP.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)