Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL registration date input

Author  Topic 

neman69
Starting Member

1 Post

Posted - 2011-02-16 : 15:45:29
I am having problems getting the registration date to input successfully into the db field, regDt. Here is my code that is having issues, line 72 (error code) is annotated:

//BEGIN:Insert to student information
function insertStudentDeatils($student_array,$registration_type)
{
// regDt = DATE(DATE_FORMAT);
line 72 $regDt = DATE NOT NULL default 'Y-m-d H:m:s';

$sql = "INSERT INTO Student SET suffix = '".addslashes($student_array['suffix'])."' ,
firstName = '".addslashes($student_array['firstName'])."',
middelName = '".addslashes($student_array['middelName'])."',
lastName = '".addslashes($student_array['lastName'])."',
gender = '".addslashes($student_array['gender'])."',
companyName = '".addslashes($student_array['companyName'])."',
address1 = '".addslashes($student_array['address1'])."',
address2 = '".addslashes($student_array['address2'])."',
city = '".addslashes($student_array['city'])."',
state = '".$student_array['state']."',
zipCode = '".addslashes($student_array['zipCode'])."',
emailAddress = '".addslashes($student_array['emailAddress'])."',
dayPhone = '".$student_array['dayPhone']."',
eveningPhone = '".$student_array['eveningPhone']."',
fax = '".$student_array['fax']."',
userName = '".addslashes($student_array['userName'])."',
password = '".addslashes($student_array['password'])."',
securityQues1 = '".addslashes($student_array['securityQues1'])."',
securityAns1 = '".addslashes($student_array['securityAns1'])."',
securityQues2 = '".addslashes($student_array['securityQues2'])."',
securityAns2 = '".addslashes($student_array['securityAns2'])."',
age = '".$student_array['age']."' ,
qualification = '".$student_array['qualification']."',
licensedAppraiserYear = '".$student_array['licensedAppraiserYear']."',
continuingEducationPerc = '".$student_array['continuingEducationPerc']."',
atlantisEducationHear = '".$student_array['atlantisEducationHear']."',
regDt = '".$student_array['regDt']."',
registrationType = '".$registration_type."'";
//echo "<br><br>==>".$sql."<br>";die();
$this->insertInto($sql);
return $this->sqlInsertId();
}


ERROR MESSAGE IN BROWSER IS AS FOLLOWS:

Parse error: syntax error, unexpected T_STRING in /home/lap99go/public_html/Models/StudentModel.php on line 72


HELP PLEASE!!!

Gary Ostrom
   

- Advertisement -