<?php
$con=mysql_connect("localhost","root","");
if(!$con)
	{
	die('Could not connect:'.mysql_error());
	}
mysql_select_db(customer1,$con)             
$sql1="INSERT INTO details(companyname,companyadd,comstate,telephone,fax,email,fname,lname,nic,mobile,username,password);VALUES('$_POST[coname]','$_POST[coadd]','$_POST[cost]','$_POST[tel]','$_POST[fax]','$_POST[mail]','$_POST[fname]','$_POST[lname]','$_POST[nic]','$_POST[mob]','$_POST[user]','$_POST[password]')"; 
if(!mysql_query($sql1,$con))
{
	die('Error:'.mysql_error());
}
echo"1 record added";
mysql_close($con)
?>

Hi..
check this two lines

mysql_select_db([B]$customer1[/B],$con)  

and

$sql1="INSERT INTO details(companyname,companyadd,comstate,telephone,fax,email,fname,lname,nic,mobile,username,password[B]) [/B]VALUES('$_POST[coname]','$_POST[coadd]','$_POST[cost]','$_POST[tel]','$_POST[fax]','$_POST[mail]','$_POST[fname]','$_POST[lname]','$_POST[nic]','$_POST[mob]','$_POST[user]','$_POST[password]')";

<?php
$con=mysql_connect("localhost","root","");
if(!$con)
{
die('Could not connect:'.mysql_error());
}
mysql_select_db(customer1,$con)
$sql1="INSERT INTO details(companyname,companyadd,comstate,telephone,fax,email,fname,lname,nic,mobile,username,password);VALUES('$_POST[coname]','$_POST[coadd]','$_POST[cost]','$_POST[tel]','$_POST[fax]','$_POST[mail]','$_POST[fname]','$_POST[lname]','$_POST[nic]','$_POST[mob]','$_POST[user]','$_POST[password]')";
if(!mysql_query($sql1,$con))
{
die('Error:'.mysql_error());
}
echo"1 record added";
mysql_close($con)
?>

check out this code

<?php
$con=mysql_connect("localhost","root","");
if(!$con)
{
die('Could not connect:'.mysql_error());
}
mysql_select_db(customer1,$con) 
$sql1="INSERT INTO details(companyname,companyadd,comstate,telephone,fax,email,fname,lname,nic,mobile,username,password)
VALUES('".$_POST['conam'e]."','".$_POST['coadd']."','".$_POST['cost']"','".$_POST['tel']."','".$_POST['fax']."','".$_POST['mail']."','".$_POST['fname']."','."$_POST['lname']."','".$_POST['nic']."','".$_POST['mob']."','".$_POST['user']."','".$_POST['password']."')";
if(!mysql_query($sql1,$con))
{
die('Error:'.mysql_error());
}
echo"1 record added";
mysql_close($con)
?>
This article has been dead for over six months. Start a new discussion instead.