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

Any alternative to use this code with php?

1 Answers1

1

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

Indrasis Datta
  • 8,692
  • 2
  • 14
  • 32