I am following the tutorial at
http://www.freewebmasterhelp.com/tutorials/phpmysql/
The source code is on the website on the left hand side
http://www.freewebmasterhelp.com/static/tutorials/phpmysql/example.zip


My software:
PHP version 4.3.4 on Windows 2000
MYSQL version 4.0.16 on Windows 2000
Apache version 1.3.29 on Windows 2000

The problem is I cannot get the database to add a new records aside from
the auto-increment field. All the other fields are left blank when the
add.html is subitted. 

I have the add.html with the following code exactly the same as the
source 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>


The insert.php
<?
include("dbinfo.inc.php");
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();
?> 



Any help would be much appreciated.

Regards,
Mark

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

Reply via email to