开发者

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(..);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜