php PDO undefined function prepare()
I'm sure that's a real easy one, but I begin with php and can't ge开发者_Python百科t what is wrong.
function createUser ($nom, $prenom, $username, $pw, $email)
{
$cnt = new PDO('mysql:host=localhost;dbname=web', 'web', 'webuser');//getConnection ();
$createUser = $cnt.prepare ('INSERT INTO user (NOM, PRENOM, USER_NAME, PW_HASH, EMAIL VALUES (?, ?, ?, ?, ?) ');
$createUser->execute (array ($nom, $prenom, $username, sha1($pw), $email));
}
I get :
Fatal error: Call to undefined function prepare() in /home/pascal/public_html/dataaccess/users.php on line 8
Line 8 being $createUser = $cnt.prepare (...
->
, not .
.
$cnt->prepare()
I think it should be like this:
$cnt->prepare(..);
精彩评论