A question about PHP to execute the MySQL statement, the head is quick to blow up, beg predecessors!
PHP to add the user's MySQL statement, ask the elder pointing ah, I did not do a good night, as follows [post acquisition]
Add $user user to localhost, password is $pass, and create a database named $user, grant read-write delete permission, hey,
Do not add variable I will make, a plus on the dizzy, old hints syntax error
For seniors, please don't pass the tooth, you are my hope Ah!
------Solution--------------------
$user = ' user ';
$pass = ' password ';
$sql = "Crearte databuse $user";
$sql =<<< SQL
Grant SELECT, INSERT, delete
On $user
to [e-mail protected] identifed by ' $pass '
SQL;
Connect to the database as root, execute two $sql in turn
If there are grammatical errors, please modify them, a bit unclear
------Solution--------------------
First of all
You're not right here.
$user = ' user ';
$pass = ' password ';
$sql = "Crearte databuse $user";
$sql = "CREATE DATABASE" + $user + "'";
Because you sent to the MySQL client, he was unable to identify the parsing $user
------Solution--------------------
The code of the landlord?
PHP Code
$user = ' user '; $pass = ' password '; $sql = "Crearte databuse $user"; $sql = "CREATE DATABASE". $user. "";