当我回显该变量$userz
时,它会在网页中写入好的用户名,当我在 mysql 查询中使用它时,它不起作用。为什么?
echo $userz; // write "Programmeur" on the web page
$bdd->exec('UPDATE user SET status = \'registered\' WHERE username =' .$userz);// not working
$bdd->exec('UPDATE users SET status = \'registered\' WHERE username = $userz');// not working
$bdd->exec('UPDATE users SET status = \'registered\' WHERE username = \'Programmeur\'');//work
是因为我正在使用wamp
还是我只是错过了什么?