我在使用 where
子句插入数据时遇到问题。这是查询:
$hi= "INSERT INTO user_detail (email, looking, username, profession, experience,
current_work, state, job_type, about, college, diploma, department)
VALUES ('$email', '$looking', '$username', '$profession','$experience',
'$current_work', '$state', '$job_type', '$about', '$college', '$diploma', '$department')
WHERE s='$username'";
它告诉我错误:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE s='aniket276'' at line 1
最佳答案
使用MySQL更新
像那样:-
UPDATE user_detail SET email='$email' WHERE s='$username';
You should rather use UPDATE, if you want to change the value of the field in records you select using the WHERE clause
关于php - 使用 Where 子句插入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33437626/