On Sun, 01 Oct 2006 19:59:08 +0100, Deckard wrote:

> Hello,
> 
> I have this code:
> 
>  // insert new user in mysql user table
>   $sqlInsertUser = "INSERT INTO user (Host, User , Password ,
> Select_priv, Insert_priv, Update_priv, Delete_priv) VALUES ('$hostname',
> '$mysql_username', '$mysql_password', 'N', 'N', 'N', 'N')";
> 
>   if (mysql_query($sqlInsertUser, $conn))
>    $messagesqlInsertUser = 'Success...';
>   else
>    $messagesqlInsertUser = 'Error: ' . mysql_error();
>   $result = mysql_query($sqlInsertUser);
> 
> that gives me the error:
> "Error: Duplicate entry 'localhost-' for key 1"
> 
> I can't see nothing wrong with it and if i run it in MySQL's prompt
> everything's fine.
> 
> Any ideas ?
> 
> Besta Regards,
> Deckard.

Hi,

Wouldn't it be easier to just use the MySQL GRANT statement?

Ivo

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to