Inserting a record into a a Dbase using a html form (MYSQL/PHP)?

Separate the values to insert by commas, not periods. E.g.

Up vote 1 down vote favorite share g+ share fb share tw.

As the title says i'm trying to insert a record into a mysql database via a html form. Here is the html form portion of the file: Addstudent. Html /div> Add another student?

Please fill out the requested fields. StudentId: Password: Dob: Firstname: Surname: Address: Town: County: Country: Postcode: Here is part of the file Insertstudent. Php The main trouble I'm having is with the Insert script - I'm obviously doing something wrong with that because my database doesn't update.

Thank you in advance to anyone who replies to this - much appreciated. Php mysql html database link|improve this question asked May 15 '11 at 16:41M_Justice78961.

Incorrect insert statement – Andrew SKYDOS Hoffmann May 15 '11 at 16:46.

Separate the values to insert by commas, not periods. E.g. : INSERT INTO table_name VALUES (value1, value2, value3,...).

Try the following syntax for inserting records into your database. INSERT INTO table_name(col1,col2,col3) VALUES(val1,val2,val3); when you make a post request from a mysql page you should be doing something like this. INSERT INTO student(studentid,password,dob,firstname,surname,address,town,country,postcode) VALUES($_POST'studentid',$_POST'password',$_POST'dob',$_POST'firstname',$_POST'surname',$_POST'address',$_POST'town',$_POST'country',$_POST'postcode'); but be aware this way you are allowing the users to input malicious code, if you do it like this they could easily do some mischief with your database like, deleting or altering the records.

To overcome this you can use a built in PHP function called mysql_real_escape_string().

Syntax is: INSERT INTO table (field1, field2) VALUES (value1, value2) NOTICE: separate values with commas (,) not periods (.).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions