开发者

php PDO undefined function prepare()

开发者 https://www.devze.com 2023-03-25 01:42 出处:网络
I\'m sure that\'s a real easy one, but I begin with php and can\'t ge开发者_Python百科t what is wrong.

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

精彩评论

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