Re: ~error,insert query failed....AND undefined index~ [message #34134 is a reply to message #34033] |
Sat, 07 October 2006 12:44 |
|
Hi,
First create the connect to database and then try, your code should be some thing like that:
<?
include 'config.php';
$name=$_POST['name'];
$emailadd=$_POST['emailadd'];
$company_name=$_POST['company_name'];
$designation=$_POST['designation'];
$address=$_POST['address'];
$address1=$_POST['address1'];
$city=$_POST['city'];
$state=$_POST['state'];
$zip_code=$_POST['zip_code'];
$country=$_POST['country'];
$phone=$_POST[phone];
$mobile=$_POST[mobile];
$email=$_POST[email];
$password=$_POST[password];
$password1=$_POST['password1'];
$payment=$_POST['payment'];
$con = mysql_connect(DB_SERVER,DB_USER,DB_PASS);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db(DB_NAME, $con);
$sql="INSERT INTO oemp_members
(`Email`,`password`,`name`,`emailadd`,`company_name`,`designation`,`address `,`address1`,`city`,`state`,`zip_code`,`country`,`phone`,`mobile`,`payment` )
VALUES
('$email','$password','$name','$emailadd','$company_name','$designation','$ address','$address1','$city','$state','$zip_code','$country','$phone','$mob ile','$payment') ";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "Information Entered"; //message you want to Show
?>
Happy Coding
-Manish Kumar
Manish Kumar
Team Leader
Aone Innvovation (P) Ltd
|
|
|