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="username">User<BR>
> <INPUT TYPE="text" NAME="password">Password<BR>
> <INPUT TYPE="submit">
> </FORM>
> <BR><BR>
> <?
> 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