If you’re using the deprecated mysql function:
$user = "121";
$pass = "dummy1";
$email = "[email protected]";
mysql_query("INSERT INTO users(username, password, email) VALUES('$user', '$pass', '$email')");
On the other hand, using mysqli
:
mysqli_query($con, "INSERT INTO users (username, password, email)
VALUES ('$user', '$pass', '$email')");
Note: where
$con
is the mysqli connection made variable.
3
solved Mysql insert into string value [duplicate]