Mysql插入字符串值[重复]

This question already has an answer here:

I want to insert values from a string like $email $password $username

mysql_query("INSERT INTO `cyrexhosting`.`users` (`username`, `password`, `email`) 
             VALUES ('123', '123', '123'");

but i don't know how

</div>

If you're using the deprecated mysql function:

$user = "121";
$pass = "dummy1";
$email = "dummy@dummy.com";


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.