Ik heb een php scriptje waarin ik een mysql user plus een database wil aanmaken. Alleen krijg ik een error:
You have an error in your SQL syntax near 'INSERT INTO db VALUES ('localhost','Testjuh','nilsje','Y','Y','Y','Y','Y','Y','Y' at line 4
Dit is de code.
Ligt dit aan het feit dat je maar 1 regel query mag invullen in PHP? nee toch?
You have an error in your SQL syntax near 'INSERT INTO db VALUES ('localhost','Testjuh','nilsje','Y','Y','Y','Y','Y','Y','Y' at line 4
Dit is de code.
code:
1
2
3
4
5
6
7
| $sqlquery = "
INSERT INTO user (Host, User, Password) VALUES ('localhost', '$user', PASSWORD('$password'));
INSERT INTO db VALUES ('localhost','$dbname','$user','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
CREATE DATABASE $dbname;
FLUSH PRIVILEGES;";
$make = mysql_query($sqlquery); |
Ligt dit aan het feit dat je maar 1 regel query mag invullen in PHP? nee toch?