hi guys...
i got another syantax error in my code... error says..
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''user_name','password','active_date','creation_date') values ('
my code as..
<?php>
ob_start();
session_unset();
session_start();
header("Cache-control: private"); //IE 6 fix*/
include "header.php";
$session['utitle'] = $POST['utitle'] ;
$session['fname'] = $POST['fname'] ;
$session['lname'] = $POST['lname'] ;
$session['dob'] = $POST['dob'] ;
$session['sex'] = $POST['sex'] ;
$session['uname'] = $POST['uname'] ;
$session['address'] = $POST['address'] ;
$session['zip'] = $POST['zip'] ;
$session['state'] = $POST['state'] ;
$session['city'] = $POST['city'] ;
$session['country'] = $POST['country'] ;
$session['wphone'] = $POST['wphone'] ;
$session['fax'] = $POST['fax'] ;
$session['hphone'] = $POST['hphone'] ;
$session['email'] = $POST['email'] ;
$session['upass'] = $POST['upass'] ;
$session['urpass'] = $POST['urpass'] ;
?>
<html>
<head>
</head>
<body>
<font face="Arial Narrow" >
<?php
// Check if user entered all fields
if (!$session['utitle']|| !$session['fname'] || !$session['lname'] || !$session['uname'] ||!$session['sex']||
!$session['upass'] || !$session['urpass']||!$session['email'] || !$session['country']
|| !$session['dob'] ||!$session['address'] || !$session['city'])
{
print '<center><font face="arial narrow" color= #FFFFFF><h2><u>NOTE</u></h2></font></center>';
print '<h3><center><font face="arial narrow" color= #FFFFFF >Please enter all manditory information!</font></center> </h3>';
exit();
}
else {
// check if password and retype pass word differs
if ($_session['upass']!= $_session['urpass'] )
{
print '<center><font face="arial narrow" color= #FFFFFF><h2>Your password differs ! </h2></font></center>';
exit();
}
else
{
// connecting to database server
include "dbconnect.php";
$host="localhost";
$user = "mala_user" ;
$pswd = "test123";
$oc ="open";
$db_connect_return=dbconnect(&$host,&$user,&$pswd,$oc);
if (!(dbconnect_return))
{
exit();
}
else
{
include "update_log.php";
// update audit_log for sucess conection to db
$user_name = $_POST['uname'] ;
$type = "DBConnect";
$status = "Success";
update_log($user_name,$type,$status);
// insert user to users table for succesful registration
$userins3 ="insert into users ('user_name','password','active_date','creation_date') values ('".$_POST['uname']."', '".$_POST['upass']."','$logday','$logday');";
$unameins3 = mysql_query($userins3) or die(mysql_error());
// insert record to user_info table in database for succesful registration
$userins1 ="insert into user_info ('user_name','fname','lname','dob','gender','address','city','state_prov','country','zip_code','fax','email','work_phone','home_phone','title')
values ('".$_POST['uname']."' , '".$_POST['fname']."' , '".$_POST['lname']."' , '".$_POST['dob']."' ,'".$_POST['sex']."'
,'".$_POST['address']."' , '".$_POST['city']."' , '".$_POST['state']."' ,'".$_POST['country']."' , '".$_POST['zip']."'
,'".$_POST['fax']."' ,'".$_POST['email']."' , '".$_POST['wphone']."' , '".$_POST['hphone']."' ,'".$_POST['utitle']."');";
$unameins1 = mysql_query($userins1) or die(mysql_error());
// update audit_log for sucess of create user
$user_name = $_POST['uname'] ;
$type = "CREATE User";
$status = "Success";
update_log(&$user_name,&$type,&$status);
// close the database
$oc = "close";
$db_connect_return=dbconnect(&$host,&$user,&$pswd,&$oc);
ob_end_flush();
}
}
}
?>
</font>
</body>
</html>
any help is greatly appreciated.
thanks
mala