0

Hi

I am pretty new to all this so bear with me. I have created some forms on dreamweaver which I want to populate mysql database when completed.

I have created a table using phpmyAdmin through godaddy. I have created a record set which links to each form field. I have also created a connection to the server which tests OK.

I am able to retrieve sample data I have entered into the mysql table but cannot send data to mysql- am getting error messsage '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...'

Can anybody please help as tearing my hair out with this..

Thanks

Jo

4
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by Richajr0
0

Pls provide the INSERT statement that you've written, there might have minor mistakes

0

i agree with all above reply post that u need to post ur insert statements
but i will give ya small help since phpmyadmin will generate the code used to insert
u can give a look at the code and see what mistake u did .. if u cant plz post the insert statement .. good luck.

0

Hi

The code is shown below. I think this is the section you are referring to. Do I need to do something to generate the code in myphpadmin?

Jo

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "register")) {
$insertSQL = sprintf("INSERT INTO Registration (email, password, whyregister, subscribe, 'where hear', aceeptT&C) VALUES (%s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST, "text"),
GetSQLValueString($_POST, "text"),
GetSQLValueString($_POST, "text"),
GetSQLValueString(isset($_POST) ? "true" : "", "defined","1","0"),
GetSQLValueString($_POST, "text"),
GetSQLValueString(isset($_POST) ? "true" : "", "defined","1","0"));


mysql_select_db($database_connectionDB, $connectionDB);
$Result1 = mysql_query($insertSQL, $connectionDB) or die(mysql_error());

Edited by happygeek: fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.