Associate
- Joined
- 19 Oct 2005
- Posts
- 528
G,day
Im adding some data to a mysql table which has a auto increment field. When i add the data using the php the table increments by one, but no other data is inserted from the PHP page. The php page drags data from a form on a html page. username,forename, password and email are the name of the fields in the html page.
thankyou muchly for any help
Im adding some data to a mysql table which has a auto increment field. When i add the data using the php the table increments by one, but no other data is inserted from the PHP page. The php page drags data from a form on a html page. username,forename, password and email are the name of the fields in the html page.
thankyou muchly for any help
Code:
<?php
include("db_connect.php");
// Connect to the database.
//If the form was submitted, process it.
//Pick up the values from the previous form
$username =$_REQUEST['CustName'];
$forename =$_REQUEST['CustAddress'];
$password =$_REQUEST['CustTelNo'];
$email =$_REQUEST['CustE-mail'];
$query = "insert into Customer values
('$CustNumber','$CustName', '$CustAddress', '$CustTelNo', '$CustE-mail')";
if (@mysql_query ($query))
{
echo 'The Customer has been added.';
}
else
{
echo 'The Customer could not be added because - ' . mysql_error();
}
?>