RE: [PHP] creating MySQL Users
$query .= ON $username; The ON clause should identify the database name, not the user. It should appear as *.*. -Original Message- From: Liam [mailto:[EMAIL PROTECTED]] Sent: Friday, March 29, 2002 4:27 PM To: [EMAIL PROTECTED] Subject: [PHP] creating MySQL Users 29/03/2002 10:26:41 PM Hi, I've been trying to work this out, but I can't. Myabe I need more sleep, I'm sure it's something really stupid. Could someone have a look over this code for me please? It's meant to add MySQL users. FORM METHOD=POST ACTION=?echo $PHP_SELF;? INPUT TYPE=text NAME=usernameUserBR INPUT TYPE=text NAME=passwordPasswordBR INPUT TYPE=submit /FORM BRBR ? if ($REQUEST_METHOD==POST) { $mysql_access = mysql_connect(localhost, root, password); if (!$mysql_access) { echo(ERROR: . mysql_error() . \n); } $query = GRANT SELECT,INSERT,UPDATE,DELETE,ALTER; $query .= ON $username; $query .= TO $username@localhost; $query .= IDENTIFIED BY '$password';; mysql_query($query, $mysql_access); print(Successfully added $username to the MySQL database!); } ? Thanks, Liam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] creating MySQL Users
Try this query : $query = GRANT SELECT,INSERT,UPDATE,DELETE,ALTER ; $query .= ON $username ; $query .= TO $username@localhost ; $query .= IDENTIFIED BY '$password';; Make sure that you put a blank space after each string, except the last one. I hope this work! Rafael Perazzo --- Liam [EMAIL PROTECTED] wrote: 29/03/2002 10:26:41 PM Hi, I've been trying to work this out, but I can't. Myabe I need more sleep, I'm sure it's something really stupid. Could someone have a look over this code for me please? It's meant to add MySQL users. FORM METHOD=POST ACTION=?echo $PHP_SELF;? INPUT TYPE=text NAME=usernameUserBR INPUT TYPE=text NAME=passwordPasswordBR INPUT TYPE=submit /FORM BRBR ? if ($REQUEST_METHOD==POST) { $mysql_access = mysql_connect(localhost, root, password); if (!$mysql_access) { echo(ERROR: . mysql_error() . \n); } $query = GRANT SELECT,INSERT,UPDATE,DELETE,ALTER; $query .= ON $username; $query .= TO $username@localhost; $query .= IDENTIFIED BY '$password';; mysql_query($query, $mysql_access); print(Successfully added $username to the MySQL database!); } ? Thanks, Liam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Greetings - send holiday greetings for Easter, Passover http://greetings.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] creating MySQL Users
I think you'll find this works better if you use PUT as your method, as opposed to POST, which is for File Uploads. (http://www.php.net/manual/en/features.file-upload.php#features.file-upl oad.post-method) Is your code ever actually getting into the 'if' construct, if not, that's probably your answer! - Joel -Original Message- From: Liam [mailto:[EMAIL PROTECTED]] Sent: Friday, March 29, 2002 2:27 PM To: [EMAIL PROTECTED] Subject: [PHP] creating MySQL Users 29/03/2002 10:26:41 PM Hi, I've been trying to work this out, but I can't. Myabe I need more sleep, I'm sure it's something really stupid. Could someone have a look over this code for me please? It's meant to add MySQL users. FORM METHOD=POST ACTION=?echo $PHP_SELF;? INPUT TYPE=text NAME=usernameUserBR INPUT TYPE=text NAME=passwordPasswordBR INPUT TYPE=submit /FORM BRBR ? if ($REQUEST_METHOD==POST) { $mysql_access = mysql_connect(localhost, root, password); if (!$mysql_access) { echo(ERROR: . mysql_error() . \n); } $query = GRANT SELECT,INSERT,UPDATE,DELETE,ALTER; $query .= ON $username; $query .= TO $username@localhost; $query .= IDENTIFIED BY '$password';; mysql_query($query, $mysql_access); print(Successfully added $username to the MySQL database!); } ? Thanks, Liam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] creating MySQL Users
DAMMIT.. It's too early, I knew I was gonna make that mistake.. GET/PUT/POST, what's the difference right? Sorry, post would be the right method to use.. agh.. Feeling incompetent now - Joel -Original Message- From: Liam [mailto:[EMAIL PROTECTED]] Sent: Friday, March 29, 2002 2:27 PM To: [EMAIL PROTECTED] Subject: [PHP] creating MySQL Users 29/03/2002 10:26:41 PM Hi, I've been trying to work this out, but I can't. Myabe I need more sleep, I'm sure it's something really stupid. Could someone have a look over this code for me please? It's meant to add MySQL users. FORM METHOD=POST ACTION=?echo $PHP_SELF;? INPUT TYPE=text NAME=usernameUserBR INPUT TYPE=text NAME=passwordPasswordBR INPUT TYPE=submit /FORM BRBR ? if ($REQUEST_METHOD==POST) { $mysql_access = mysql_connect(localhost, root, password); if (!$mysql_access) { echo(ERROR: . mysql_error() . \n); } $query = GRANT SELECT,INSERT,UPDATE,DELETE,ALTER; $query .= ON $username; $query .= TO $username@localhost; $query .= IDENTIFIED BY '$password';; mysql_query($query, $mysql_access); print(Successfully added $username to the MySQL database!); } ? Thanks, Liam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php