I have a problem with prepared statements with PDO and Mysql:
when i do the following:
Code: Select all
$count = $db->exec("INSERT INTO Customer VALUES ('".$userName ."','". $password .
"','". $shippingAdd ."','". $billingAdd . "','". $rating ."','". $email ."')");
$db->commit();
Code: Select all
$sth = $db->prepare ("INSERT INTO CUSTOMER(username, password, Shipping_Address, Billing_Address, rating, email_Address) VALUES (:uname, :password, :shipAddress, :billAddress, :rating, :email)");
$sth->bindValue(':uname:', $userName);
$sth->bindValue(':password', $password);
$sth->bindValue(':shipAddress', $shippingAdd);
$sth->bindValue(':billAddress', $billingAdd);
$sth->bindValue(':rating', $rating);
$sth->bindValue(':email', $email);
$sth->execute();
$db->commit();
am i doing something wrong in my code?