Join Form

7 posts by 3 authors in: Forums > CMS Builder
Last Post: November 12, 2010   (RSS)

Hi

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
Thanks



Craig

KC Media Solutions

www.kcmedia.biz
Attachments:

join.php 3K

mail.php 4K

Re: [chris] Join Form

Hi Chris

where abouts to i put that line of code and on what page.
Thanks



Craig

KC Media Solutions

www.kcmedia.biz

Re: [kcmedia] Join Form

By Chris - November 11, 2010

Hi Craig,

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.
All the best,
Chris

Re: [chris] Join Form

Hi Chris

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
Thanks



Craig

KC Media Solutions

www.kcmedia.biz

Re: [kcmedia] Join Form

By Jason - November 12, 2010

Hi Craig,

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

You're going to want to escape those variables too, to prevent against SQL injection attacks!
All the best,
Chris