我使用以下代码更新mysql数据库中的表。 它没有工作[重复]

This question already has an answer here:

$query = "update admin set username = $username and password = $password where id = 1;

Any alternative to use this code with php?

</div>

You need to use quotes around the variables.

Try this:

$query = "UPDATE admin SET username = '".$username."', password = '".$password."' WHERE id = 1";

Hope this helps.

Peace! xD