Problem with double quotes

Codes here !

Moderators: macek, egami, gesf

Strahan201
New php-forum User
New php-forum User
Posts: 2
Joined: Tue Apr 01, 2014 2:31 pm

Problem with double quotes

Postby Strahan201 » Tue Apr 01, 2014 2:46 pm

Hi. I'm having a problem and it's likely something stupid I am overlooking, but I am not sure what's wrong. I am displaying an HTML form to have the user input into a text field. When you submit it with single quotes, works fine. If you use double, the DB doesn't update. Here's the code:

(grabbing data from user)

Code: Select all

<form name=data method=post action=index.php>
<input type=text name=field size=40>
<input type=submit>


(saving)

Code: Select all

$sql = $pdo->prepare("INSERT INTO table (field) VALUES (?)");
$sql->execute(array($_REQUEST["field"]));


It throws no errors, just doesn't insert. Any ideas?

Return to “mySQL & php coding”

Who is online

Users browsing this forum: No registered users and 1 guest

cron