Database uploading

  • Profile Image
    alanelsom
    Asked on December 20, 2012 at 12:11 PM

    Hiya,

    I have been using Jotforms recently....but wondered if when a form gets submitted and emailed to me, is there anyway of having the data squirted to my MySqldatabase that I have on our website?

    Any info would be great.

     

    Ta

    Al

  • Profile Image
    fxr
    Answered on December 20, 2012 at 01:51 PM

    Hi Al,

    We have a guide on this:

    @ http://www.jotform.com/help/126-How-to-Insert-Update-Submissions-to-Your-MySQL-Database-Using-PHP

    Its obviously a relatively complex process to setup, if you are brave enough to have a go, let us know if you have any questions or run into any problems and we will do our best to help you out.

     

  • Profile Image
    alanelsom
    Answered on February 19, 2013 at 04:45 AM
    Hi….I got this reply from you a few weeks back and having been playing with it….

    Couple of questions….I am relatively new with dealing with Msql and coding etc….but can fumble my way through….but I have come up against a problem my experience just cant fathom out….

    I have used your test form and script to give me an idea of how things work….I have also set up fields in the database…..I can get the form to upload etc….but Im having problems with the “Array” thing….with standard text like “Name”….its fine….upload the form and it populates into the correct field on mysql….but when it comes to phone number as per your script nothing goes in…..and if I have a tick box…..then it populates the field with “Array”…..

    Have you any ideas??? Its driving me crazy…..any help or further instructions you can give would be great.

    Many thanks

    Al

    Admin Dept
    email: adminservices@elsoms.co.uk
    elsoms inventories
    property services and will practitioners
    HO: Keystone House, 17 Ware Rd,
    Hertford, Hertfordshire, SG13 7DZ
    Tel: 0808 186 9509
    Fax: 01992 350050
    web: www.elsoms.co.uk
    email: adminservices@elsoms.co.uk

  • Profile Image
    EltonCris
    Answered on February 19, 2013 at 08:53 AM

    @alanelsom

    Note that the SQL guide provided by my colleague uses "Phone" tool under Quick Tools in its example. It is not similar to a normal phone text box field as what I have seen on your form. http://www.jotformeu.com/form/30483295919363. You should use that tool in order to get use of the array code as seen on that guide since phone number tool has two separate text boxes in it unlike creating a phone number using a normal text box.

    However if you'd like to use a single text box field for your phone number, you should declare your PHP code like this.

    $phonenumber = $_POST['phone'];

    You should not include the array anymore since it uses a single text box.

    --

    With regards to the check boxes, each check box options has its index names e.g. [tick][0], [tick][1], [tick][2]. So to declare it in PHP, this way.

    $tick = $_POST['tick'][0]. "<br />" .$_POST['tick'][1]. "<br />" .$_POST['tick'][2];

    The index number depends on how many options you had on your check box field.

    Hope this helps. Thanks!

  • Profile Image
    alanelsom
    Answered on February 19, 2013 at 11:57 AM
    Hiya….thanks for coming back to me….

    Just one other field I had problems with similar to the questions before…but I forgot to ask….Is the date field….its doing the same….it does displays the field name in Mysql in the table….so where the date should be it just displays….”datefor” which is what the default name is….any ideas??

    Al

    Admin Dept
    email: adminservices@elsoms.co.uk
    elsoms inventories
    property services and will practitioners
    HO: Keystone House, 17 Ware Rd,
    Hertford, Hertfordshire, SG13 7DZ
    Tel: 0808 186 9509
    Fax: 01992 350050
    web: www.elsoms.co.uk
    email: adminservices@elsoms.co.uk

  • Profile Image
    Welvin
    Answered on February 19, 2013 at 01:06 PM

    Hi Al,

    It is q9_dateFor.With separate names such us;

    q9_dateFor[day]

    q9_dateFor[month]

    q9_dateFor[year]


    Thanks

  • Profile Image
    alanelsom
    Answered on February 19, 2013 at 01:17 PM
    Hiya,

    Thanks for your response…but how does that look in php code….you’ll have to excuse me cause I’m very new to php codes etc…

    Ta

    Al

    Admin Dept
    email: adminservices@elsoms.co.uk
    elsoms inventories
    property services and will practitioners
    HO: Keystone House, 17 Ware Rd,
    Hertford, Hertfordshire, SG13 7DZ
    Tel: 0808 186 9509
    Fax: 01992 350050
    web: www.elsoms.co.uk
    email: adminservices@elsoms.co.uk

  • Profile Image
    EltonCris
    Answered on February 20, 2013 at 04:41 AM

    Hi,

    Sorry for the delay. To use it in PHP do it like this.

    $date = $_POST[datefor][0]. "/" .$_POST[datefor][1]. "/" .$_POST[datefor][2];

    The date format is day/month/year, that's what you are using currently.

    Let us know if you have further questions. Thanks!

  • Profile Image
    alanelsom
    Answered on February 21, 2013 at 04:17 AM
    Hiya….

    I’m really sorry to keep asking about this…..thanks for the replies so far….

    I have changed the script as per your instructions but I keep getting the same outcome….

    In the field column on the data base it just puts date or what ever I call the field on the form….its doesn’t put the actual data… As it’s a date do I need any special info on MySql at all….the date field on Mysql is set at VAR50 and no other special attributes….

    Any help would be great….and again so so sorry for bugging you on this….everything else is ok apart from the date

    Al

    Admin Dept
    email: adminservices@elsoms.co.uk
    elsoms inventories
    property services and will practitioners
    HO: Keystone House, 17 Ware Rd,
    Hertford, Hertfordshire, SG13 7DZ
    Tel: 0808 186 9509
    Fax: 01992 350050
    web: www.elsoms.co.uk
    email: adminservices@elsoms.co.uk

  • Profile Image
    EltonCris
    Answered on February 21, 2013 at 07:07 AM

    Hello,

    It's okay, we'd love to help you here!  :)

    For the date field VAR50 is enough I guess. It just function the same as the normal text boxes you had. Did you double check the database name on your date field? Can you give us a snapshot on the database structure and your PHP codes? This should help us diagnose the problem.

    Looking forward to your reply. Thanks!

     

  • Profile Image
    alanelsom
    Answered on February 21, 2013 at 11:29 AM
    Hiya…

    Thanks for helping out….I have attached a few screens shot of MySql and also the text file of php called uploader…..

    If you need to get on the database let me know as its just a test DB at the moment till I can get my head around the functionality….really grateful for you guys helping

    Al

    Admin Dept
    email: adminservices@elsoms.co.uk
    elsoms inventories
    property services and will practitioners
    HO: Keystone House, 17 Ware Rd,
    Hertford, Hertfordshire, SG13 7DZ
    Tel: 0808 186 9509
    Fax: 01992 350050
    web: www.elsoms.co.uk
    email: adminservices@elsoms.co.uk

  • Profile Image
    Welvin
    Answered on February 21, 2013 at 02:08 PM

    Hi Al,

    Our forum cannot accept email attachments so please kindly use this uploader:

    https://cms.jotform.com/help/image_upload.php?naked=true

    ...upload the images and get the link after and paste it on your response.

     

    Thanks

  • Profile Image
    alanelsom
    Answered on February 25, 2013 at 08:23 AM
    Hiya….

    Thanks….I have uploaded and sent it…its in PDF and called “fileforchapsatjotform”

    Thanks

    Al

    Admin Dept
    email: adminservices@elsoms.co.uk
    elsoms inventories
    property services and will practitioners
    HO: Keystone House, 17 Ware Rd,
    Hertford, Hertfordshire, SG13 7DZ
    Tel: 0808 186 9509
    Fax: 01992 350050
    web: www.elsoms.co.uk
    email: adminservices@elsoms.co.uk

  • Profile Image
    alanelsom
    Answered on February 25, 2013 at 08:25 AM
    Hi Welvin,

    Did you get the uploads I sent over yesterday?

    Al

    Admin Dept
    email: adminservices@elsoms.co.uk
    elsoms inventories
    property services and will practitioners
    HO: Keystone House, 17 Ware Rd,
    Hertford, Hertfordshire, SG13 7DZ
    Tel: 0808 186 9509
    Fax: 01992 350050
    web: www.elsoms.co.uk
    email: adminservices@elsoms.co.uk

  • Profile Image
    EltonCris
    Answered on February 25, 2013 at 08:41 AM

    @alanelsom

    Sorry to say but we did not received any of the files you've mentioned. If you have attached the files to your email, please post it directly on this forum thread instead. http://www.jotform.com/answers/159101-Database-uploading. You can use the image uploader provided by Welvin on his previous response. After uploading the files, post here the image URLs.

    Thank you!

  • Profile Image
    alanelsom
    Answered on February 26, 2013 at 08:11 AM
    Hi….As requested I have resent the uploads…..

    There are 4 files….called “fromaelsom 1of5”…..(2of5, 3of5, 4&5of5)

    Hope this helps

    Regards

    Al

    Admin Dept
    email: adminservices@elsoms.co.uk
    elsoms inventories
    property services and will practitioners
    HO: Keystone House, 17 Ware Rd,
    Hertford, Hertfordshire, SG13 7DZ
    Tel: 0808 186 9509
    Fax: 01992 350050
    web: www.elsoms.co.uk
    email: adminservices@elsoms.co.uk

  • Profile Image
    alanelsom
    Answered on February 26, 2013 at 08:15 AM
    Hi….As requested I have resent the uploads…..

    There are 4 files….called “fromaelsom 1of5”…..(2of5, 3of5, 4&5of5)

    Hope this helps

    Regards

    Al

    Admin Dept
    email: adminservices@elsoms.co.uk
    elsoms inventories
    property services and will practitioners
    HO: Keystone House, 17 Ware Rd,
    Hertford, Hertfordshire, SG13 7DZ
    Tel: 0808 186 9509
    Fax: 01992 350050
    web: www.elsoms.co.uk
    email: adminservices@elsoms.co.uk

  • Profile Image
    Welvin
    Answered on February 26, 2013 at 09:10 AM

    Hi Al,

    Resent to where? Here in our Forum or to our Email Support (support@jotform.com). I've check your email address from our email support and I couldn't find any message from you.

    If you are using our image uploader: https://cms.jotform.com/help/image_upload.php?naked=true, please kindly get the URL's on the Image URL box before uploading the next image. Paste the URL's on your reponse.

    Thanks

  • Profile Image
    alanelsom
    Answered on February 26, 2013 at 12:31 PM
    Hi Welvin,

    Here you go hopefully you’ll get them this time…..All below…


    https://cms.jotform.com/uploads/image_upload/image_upload/global/13572_fromaelsom_1of5.jpg
    https://cms.jotform.com/uploads/image_upload/image_upload/global/13573_fromaelsom_2of5.jpg
    https://cms.jotform.com/uploads/image_upload/image_upload/global/13574_fromaelsom_3of5.jpg
    https://cms.jotform.com/uploads/image_upload/image_upload/global/13575_fromaelsom_4and5of5.jpg



    Al


    Admin Dept
    email: adminservices@elsoms.co.uk
    elsoms inventories
    property services and will practitioners
    HO: Keystone House, 17 Ware Rd,
    Hertford, Hertfordshire, SG13 7DZ
    Tel: 0808 186 9509
    Fax: 01992 350050
    web: www.elsoms.co.uk
    email: adminservices@elsoms.co.uk

  • Profile Image
    Welvin
    Answered on February 26, 2013 at 01:21 PM

    Hi Al,

    Got them, thanks. My colleague will be in touch with you later on.

     

    Thanks

  • Profile Image
    EltonCris
    Answered on February 26, 2013 at 02:10 PM

    I've found the error.

    One of your date variable is lacking "$" sign. Check this screen. Thanks!

  • Profile Image
    alanelsom
    Answered on March 01, 2013 at 02:32 AM
    Thanks Elton…you’re a Star…

    Many thanks for your help

    Al

    Admin Dept
    email: adminservices@elsoms.co.uk
    elsoms inventories
    property services and will practitioners
    HO: Keystone House, 17 Ware Rd,
    Hertford, Hertfordshire, SG13 7DZ
    Tel: 0808 186 9509
    Fax: 01992 350050
    web: www.elsoms.co.uk
    email: adminservices@elsoms.co.uk

  • Profile Image
    Welvin
    Answered on March 01, 2013 at 03:29 AM

    Hi Al,

    In behalf of my colleague Elton, you are always welcome. 

    Cheers!

  • Profile Image
    alanelsom
    Answered on March 04, 2013 at 05:22 AM
    Hi Welvin….

    Thanks so much for you chaps helping me out….I have sorted out the database stuff and all forms are fantastic…just a small query…..

    I am using the forms in an iFrame…..and they open up and do everything they should….only problem is…. When I used a default Thank You page…after data was submitted the thank you page stayed within the iFrame….but now we have a Custom URL so we can submit to database….after you hit submit….when it goes to thank you it opens up as a new page across the screen rather than staying in the iFrame….you need to hit the back button twice before it returns them to the site…. Ideally once a form is submitted I just want the thankyou to stay in the iFrame….I know its probably only a small bit of code….But I need to know where to put it so the form doesn’t overtake the website after submission.

    Any Ideas? Thanks Guys (again)

    Al

    Admin Dept
    email: adminservices@elsoms.co.uk
    elsoms inventories
    property services and will practitioners
    HO: Keystone House, 17 Ware Rd,
    Hertford, Hertfordshire, SG13 7DZ
    Tel: 0808 186 9509
    Fax: 01992 350050
    web: www.elsoms.co.uk
    email: adminservices@elsoms.co.uk

  • Profile Image
    EltonCris
    Answered on March 04, 2013 at 07:41 AM

    Hi AI,

    Sorry to say but that is how "Custom URL" thank you option works. It needs to be loaded on a new page. I would suggest to embed your php script on the same site (just another page on the same site I guess) so it still lands on the same site after submitting the form. Then on the thank you page, add a link to the form page so they just need to click on it instead of hitting the browser back button twice. How's this? This is the best workaround I could think, maybe my other colleagues has a better solution for this.

    Hope this still helps. Thanks!