Re: basic form entry
| From: | OKi98 | Date: | Mon, 08 Oct 2007 08:58:02 +0000 |
| Subject: | Re: basic form entry | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-44174@lists.php.net to get a copy of this message | ||
most likely you have a problem in your query but you dont understand how to use mysql_error.
from http://www.php.net/manual/en/function.mysql-error.php :
string *mysql_error* ( [resource $link_identifier] )
Returns the error text from the last MySQL function
echo mysql_error(mysql_connect($host,$username,$psswd)); you see now? you are creating new connection. correct code should appear similar to this:$connection=mysql_connect($host,$username,$psswd) or die ("errror in access db"); mysql_select_db($db,$connection); if (!mysql_query ("INSERT INTO users (First,Last,Phone,Mobile,Email,Web) VALUES ('$first_name','$last','$phone,'$mobile','$email','$web') ",$connection)) echo("error ".mysql_error($connection));