Strange error in PHP/MySQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux