當我回顯變量$userz
時,它在網頁中寫入了良好的用戶名,當我在mysql查詢中使用它時,它不起作用。爲什麼?PHP變量在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
還是我只是想念什麼?
歡迎您。在我的城市下午4:26;) – Nemoden 2013-04-22 05:26:32