I make this script. I have a problem, the data entered in the form wont insert into MYSQL, the database added new row but with blank database. Is there something wrong with the script? because i install phpnuke and i can added new data into mysql.
Thanks, i need solve this problem A.S.A.P, with your kind help o PHP-er....

Thanks..

using
PHP 4.2
Apache 1.3
========================code===================
<form action="insert.php" method="post">
First Name: <input type="text" name="first"><br>
Last Name: <input type="text" name="last"><br>
Phone: <input type="text" name="phone"><br>
Mobile: <input type="text" name="mobile"><br>
Fax: <input type="text" name="fax"><br>
E-mail: <input type="text" name="email"><br>
Web: <input type="text" name="web"><br>
<input type="Submit">
</form>
<?PHP
$username="root";
$password="";
$database="belajarPHP";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "INSERT INTO contacts VALUES ('','$first','$last','$phone','$mobile','$fax','$email','$web')";
mysql_query($query);
mysql_close();


?>


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

Reply via email to