MySQL Forums
Forum List  »  MySQL Administrator

SQL syntax error
Posted by: Biju PV
Date: December 15, 2010 12:38AM

Hello, i am new to this world, can anyone help me on this. I ma trying to submit a php based form to the DB (Mysql5.0), my prosessor.php file look like below.

what am I doing wrong here?

<?php

$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));

mail

("studentservices@murdochdubai.ac.ae","test - Form submission","$query = INSERT INTO form ('First Name','
Middle Name',
'Last Name',
'Murdoch

Student ID Number','
Course Enrolled In',
'Date Of Birth','
Place Of Birth',
'Present Address',
'Permanent Address','Email Address',
'Mobile Number','
Home Phone

Number','
Can the University reach you via SMS?','
Nationality',
'Parent Name (Father)','
Parent Name (Mother)','
Family Name','
Present Address','
Phone Number',
'Email Address','
Emergency Contact Name','
Relationship',
'Mobile Number') VALUES

('first_name','middle_name','last_name','id','course_enroled','dob','pre_address_st','per_address_st','email_st','mobile_st','home_st','sms','nationa

lity','f_name_p','m_name_p','fly_name_p','Pre_address_p','phone_p','email_p','c_name_emer','c_relation','
mobile_emer')"


powered by test.
");

$link

= mysql_connect('localhost', 'root', 'global123')
or die('Could not connect: ' . mysql_error());

mysql_select_db('pds') or die('Could not select

database');

// Performing SQL query
$query = "insert into table1('column1','column2') values('value1','value2')";
$result = mysql_query($query) or die('Query

failed: ' . mysql_error());


include ("confirm.html");

?>



Edited 1 time(s). Last edit at 12/15/2010 12:39AM by Biju PV.

Options: ReplyQuote


Subject
Written By
Posted
SQL syntax error
December 15, 2010 12:38AM
February 02, 2011 10:36AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.