Join Form
7 posts by 3 authors in: Forums > CMS Builder
Last Post: November 12, 2010 (RSS)
By KCMedia - November 10, 2010
I have this issue with form that we are trying to push collected data to the cms builder database to store.
someone fills out the form and it will publish the data to the DB and also email the data, can get the get to email but not publish to the DB.
hope someone can help
thanks
Craig
Craig
KC Media Solutions
www.kcmedia.biz
Re: [kcmedia] Join Form
By Chris - November 10, 2010
The first thing I'd do would be to add error reporting to your mysql_query, like this:
mysql_query($sql) or die("MySQL Error:<br/>\n". htmlspecialchars(mysql_error()) . "\n");
That should help you figure out what's going wrong.
I hoep this helps! Please let me know if you have any questions.
Chris
Re: [chris] Join Form
By KCMedia - November 10, 2010
where abouts to i put that line of code and on what page.
Craig
KC Media Solutions
www.kcmedia.biz
Re: [kcmedia] Join Form
By Chris - November 11, 2010
You'll want to add that anywhere you call mysql_query, just to be on the safe side. In the attachments you posted, you're only calling mysql_query in mail.php on line 44.
Chris
Re: [chris] Join Form
By KCMedia - November 11, 2010
I have put that line in now and when i fill out the form this is the error i get
MySQL Error:
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 '10:34 am, Friday, 12/11/10 10:34 am, Craig, kermond, kjkj, kjlkj, jlkj, craig@kc' at line 1
thanks
Craig
Craig
KC Media Solutions
www.kcmedia.biz
Re: [kcmedia] Join Form
By Jason - November 12, 2010
It looks like a problem with how you're formatting the date. You can use the MySQL function NOW() to use the current server time stamp. Try using this SQL Query:
$sql = "INSERT INTO `cms_members SET
createdDate = NOW(),
updatedDate = NOW(),
createdByUserNum = 0,
updatedByUserNum = 0,
fname = '$fname',
lname = '$lname',
address = '$address',
suburb = '$suburb',
pcode = '$pcode',
email = '$email',
phone = '$phone',
source = '$source',
age = '$age'";
Give that a try and let me know if you still get an error.
Hope this helps.
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] Join Form
By Chris - November 12, 2010
Chris