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 'reasons = '', birthplace = '' dob_month = 'January', dob_day = '' at line 8


Hello aLL

I am developing an online registration form that that a mail application that submits the data to databa and send copy to an email.

when i test drive the form, it gives me the error message above.

i need help,if possible i can send the file to anyone who wants to help me thank you

Recommended Answers

All 4 Replies

I think you should post your code too, not only the error message.

<?php session_start();
include("../Connections/recruit.php");


echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">";
//check certification
$certification = $HTTP_POST_VARS;
if($certification != "accept")
{        echo(" Your application has been terminated as a result of uncertified information!");?> </font></div>



<? end;
}
else{
//post time
$date_posted = date ("l, jS of , Y h:i:s A");


// pass session vars into simple vars
//personal data
$title = $HTTP_SESSION_VARS;
$firstname = $HTTP_SESSION_VARS;
$middlename = $HTTP_SESSION_VARS;
$surname = $HTTP_SESSION_VARS;
$priornames = $HTTP_SESSION_VARS;
$reasons = $HTTP_SESSION_VARS;
$birthplace = $HTTP_SESSION_VARS;
$dob_month = $HTTP_SESSION_VARS;
$dob_day = $HTTP_SESSION_VARS;
$dob_year = $HTTP_SESSION_VARS;
$sex = $HTTP_SESSION_VARS;
$nigeria_address = $HTTP_SESSION_VARS;
$state_of_origin = $HTTP_SESSION_VARS;
$lga = $HTTP_SESSION_VARS;
$current_address = $HTTP_SESSION_VARS;
$phone = $HTTP_SESSION_VARS;
$fax = $HTTP_SESSION_VARS;
$email = $HTTP_SESSION_VARS;
$eyes = $HTTP_SESSION_VARS;
$hair = $HTTP_SESSION_VARS;
$special_features = $HTTP_SESSION_VARS;
$height = $HTTP_SESSION_VARS;
$weight = $HTTP_SESSION_VARS;
$marital_status = $HTTP_SESSION_VARS;
$kinname = $HTTP_SESSION_VARS;
$kin_address = $HTTP_SESSION_VARS;
$kin_relationship = $HTTP_SESSION_VARS;


//resume
$resume = $HTTP_SESSION_VARS;
?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>
:: Recruitment (Status)</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><style TYPE="text/css"><!--  A:link {text-decoration: none; color:#000055}  A:visited {text-decoration: none; color:#000055}  A:active {text-decoration: none; color:#000022}   A:hover {text-decoration: ; color:#00CC00 }--></style><div align="center">   <table width="780" border="0" cellpadding="0" cellspacing="2" bgcolor="#FFFFFF">    <tr>       <td><div align="center">           <table border="0" cellpadding="0" cellspacing="0" width="760">            <!-- fwtable fwsrc="3banner.png" fwbase="3banner.jpg" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->            <tr>               <td><img src="bannerhome/spacer.gif" width="67" height="1" border="0" alt="" /></td>              <td><img src="bannerhome/spacer.gif" width="491" height="1" border="0" alt="" /></td>              <td><img src="bannerhome/spacer.gif" width="202" height="1" border="0" alt="" /></td>              <td><img src="bannerhome/spacer.gif" width="1" height="1" border="0" alt="" /></td>            </tr>            <tr>               <td colspan="3">
<img name="3banner_r1_c1" src="../images/banner_r1_c1.jpg" width="760" height="6" border="0" id="3banner_r1_c1" alt="" /></td>              <td><img src="bannerhome/spacer.gif" width="1" height="6" border="0" alt="" /></td>            </tr>            <tr>               <td rowspan="4">
<img name="3banner_r2_c1" src="../images/logo.jpg" width="67" height="129" border="0" id="3banner_r2_c1" alt="" /></td>              <td rowspan="3"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="491" height="122">
<param name="movie" value="../flash/banner_recruit.swf" />
<param name="quality" value="High" />
<embed src="../flash/banner_recruit.swf" quality="High" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="491" height="122"></embed></object></td>              <td>
<img name="3banner_r2_c3" src="../images/3banner_r2_c3.jpg" width="202" height="23" border="0" id="3banner_r2_c3" alt="" /></td>              <td><img src="bannerhome/spacer.gif" width="1" height="23" border="0" alt="" /></td>            </tr>            <tr>               <td>
<img name="3banner_r3_c3" src="../images/recruit.jpg" width="202" height="61" border="0" id="3banner_r3_c3" alt="" /></td>              <td><img src="bannerhome/spacer.gif" width="1" height="61" border="0" alt="" /></td>            </tr>            <tr>               <td rowspan="2">
<img name="3banner_r4_c3" src="../images/3banner_r4_c3.jpg" width="202" height="45" border="0" id="3banner_r4_c3" alt="" /></td>              <td><img src="bannerhome/spacer.gif" width="1" height="38" border="0" alt="" /></td>            </tr>            <tr>               <td>
<img name="3banner_r5_c2" src="../images/3banner_r5_c2.jpg" width="491" height="7" border="0" id="3banner_r5_c2" alt="" /></td>              <td><img src="bannerhome/spacer.gif" width="1" height="7" border="0" alt="" /></td>            </tr>          </table>        </div></td>    </tr>    <tr>       <td height="27"> <div align="center">           <table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#CCCCCC">            <tr>               <td height="25"> <div align="center">                   <table width="100%" border="0" cellpadding="2" cellspacing="2">                    <tr valign="top">                       <td width="81%" height="26" bgcolor="#CCCCCC"> <div align="center">                         </div></td>                      <td width="19%" rowspan="2" bgcolor="#000055"><table width="100%" border="0" cellspacing="0" cellpadding="0">                          <tr>                             <td>
<img border="0" src="../images/fadeflare.jpg" width="185" height="252"></td>                          </tr>                          </table></td>                    </tr>                    <tr>                       <td valign="top" bgcolor="#FFFFFF">



<div align="center"><font face="Arial" color="#FF0000" size="2">
<?


/* recipients */


$to  = "spicysaratx@yahoo.com";


/* subject */
$subject = "Application form submission from"." ".$firstname." ".$surname." (".$email.")";


/* message */
$message = "Your application form has been completed with the following details"."\n\n".
"Remote form submission time: "."$posttime"."\n".
"[Personal Data]"."\n".
"Title : $title"."\n".
"First Name : $firstname"."\n".
"Middle Name : $middlename"."\n".
"Surname : $surname"."\n".
"Prior Names Used : $priornames"."\n".
"Reasons for Name Change : $reasons"."\n".
"Place of Birth : $birhplace"."\n".
"Name : $kinname"."\n".
Address : $kin_address
Relatonship : $kin_relationship"."\n".
Nigeria Address : $nigeria_address"."\n".
State of Origin : $state_of_origin"."\n".
Current Address : $current_address"."\n".
Phone : $phone"."\n".
Fax : $fax"."\n".
Email : $email"."\n".
Occupation : $occupation"."\n".
Color of Eyes : $eyes"."\n".
Color of Hair : $hair"."\n".
Special Features : $special_features"."\n".
Height : $height"."\n".
Weight : $weight"."\n".
"Date of Birth : $dob_month $dob_day, $dob_year
Gender : $sex
Marital Status : $marital_status



/* additional headers */
$headers = "To: webmaster<spicysaratx@yahoo.com>\r\n";
$headers .= "From:"."$email"."\r\n";
$headers .= "Reply-to:"."$email"."\r\n";
$headers .= phpversion();


/* and now mail it */



//print_r($_SESSION);


// SELECT DATABASE
mysql_select_db($database_recruit) or die(mysql_error());
$result = mysql_query(" insert into users_cv
SET
title = '$title',
firstname = '$firstname',
middlename = '$middlename',
surname = '$surname',
priornames = '$priornames'
reasons = '$reasons',
birthplace = '$birthplace'
dob_month = '$dob_month',
dob_day = '$dob_day',
dob_year = '$dob_year',
sex = '$sex'
nigeria_address = '$nigeria_address'
state_of_origin = '$state_of_origin',
lga = '$lga',
current_address = '$current_address',
contact_details = '$contact_details',
phone = '$phone',
fax = '$fax',
occupation = '$occupation',
identification = '$identification',
eyes = '$eyes',
hair = '$hair',
special_features = '$special_features',
marital_status = '$marital_status',
kinname = '$kinname',
kin_address = '$kin_address',
kin_relationship = '$kin_relationship',
date_posted = '$date_posted',
resume = '$resume' ") or die(mysql_error());
//



if(mail($to, $subject, $message, $headers))
{
echo "Your application has been submitted!";
}
}                       ?>                        </font></p>                        </div></td>                    </tr>                  </table>                </div></td>            </tr>          </table>        </td>    </tr>    <tr>       <td height="27"><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999">          <tr>             <td><div align="center">                 <table width="100%" border="0" cellspacing="0" cellpadding="0">                  <tr>                     <td><div align="center">
<font face="verdana" size="1">
<a href="">Home</a> :
<a href="">About Us</a>
: <a href="">Services</a>
: <a href="">Careers</a>
: <a href="">Clients</a>
: <a href="">Contact Us</a></font></div></td>                  </tr>                  <tr>                     <td><div align="center"><font size="1" face="Verdana">
© NAS inc 2003-2008.All Rights Reserved.</font></div></td>                  </tr>                </table>              </div></td>          </tr>        </table></td>    </tr>  </table>  <font color="#006699" size="1" face="Verdana"><a href="http://www.nasinctv.com">
Site developed by nasinc </a></font></div></body></html>
Member Avatar for Zagga

Hi bluetoot,

You are missing some comma's seperating your SET variables.
birthplace = '$birthplace',
for example.

Also, please use the CODE tags when posting code, it makes it much easier to read.


Hope this helps.
Zagga

Hi bluetoot,

You are missing some comma's seperating your SET variables.
birthplace = '$birthplace',
for example.

Also, please use the CODE tags when posting code, it makes it much easier to read.


Hope this helps.
Zagga

thanks Zagga it worked but i have another error message on line 108

Parse error: syntax error, unexpected T_STRING in

this is the code
$headers = "To: webmaster<spicysaratx@yahoo.com>\r\n";

this is here
/* additional headers */
$headers = "To: webmaster<spicysaratx@yahoo.com>\r\n";
$headers .= "From:"."$email"."\r\n";
$headers .= "Reply-to:"."$email"."\r\n";
$headers .= phpversion();

/* and now mail it */

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.