The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> DELETE not working in database
tudsy
post Sep 20 2017, 07:40 AM
Post #1


Advanced Member
****

Group: Members
Posts: 246
Joined: 30-September 14
Member No.: 21,611



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: 1574
Attached File  unsubscribe1.php ( 2.03k ) Number of downloads: 1588
Attached File  Sorrytoseeyougo.html ( 1.02k ) Number of downloads: 1560
Attached Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
tudsy
post Sep 21 2017, 01:14 AM
Post #2


Advanced Member
****

Group: Members
Posts: 246
Joined: 30-September 14
Member No.: 21,611



Hi

It works now!!!

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

Thanks.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Sep 21 2017, 11:40 AM
Post #3


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



The curly braces({}) are fine but I have no idea what the percent sign (%) is or even if it applies to PHP.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
3 User(s) are reading this topic (3 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th March 2024 - 09:00 AM