FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » General » PHP discussions » ~error,insert query failed....AND undefined index~
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
icon14.gif  Re: ~error,insert query failed....AND undefined index~ [message #34134 is a reply to message #34033] Sat, 07 October 2006 12:44 Go to previous message
manishsanger is currently offline  manishsanger   India
Messages: 1
Registered: October 2006
Location: India
Karma:
Junior Member

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
[Message index]
 
Read Message
Read Message icon14.gif
Previous Topic: Creating Simple Redirect links
Next Topic: Apache on local pc -> DocumentRoot on a remote nas
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 22:31:06 GMT 2024

Total time taken to generate the page: 0.04778 seconds