Form builder MySQL problems

User 236055 Photo


Registered User
51 posts

I am trying to send all form info to a MySQL database but nothing seems to be working. There is no support info for the SQL integration that I can find.

I have:
1. set up a database on my server
2. configured the form to send data to the database ( note: it asks for table name ??? so I did put a table in PHPMyadmin
3. Post using form and no data has been sent to the database although form comes back saying info sent??

I am using cPanel but nothing seems to be doing the trick. If anybody has an idiots guide to setting this up I would very much appreciate the help.
What I am attempting to do is post the form data to MySQL then fetch the data back (PHP) to present into a webpage. All help gladly received

Phil
Web Developer UK
User 464893 Photo


Ambassador
1,611 posts

I have not tried to use MySQL yet, I prefer using a flat file system as some of the free hosts I use do not give that ability. But! having said that once you have the database created the form builder creates the table with the name you give it and the fields according to the object names.

I have had problems getting access to databases for other reasons and for me it has been either the host name or user name sometimes the host creates a user name which you have to use.
If you use your file manager to go into the form storage folder I believe their should be a log file that may shed a light on it.
Looks like I will have to set up a form with entry to a database to see what ticks. I do a lot of trials with wamp on my computer so I will knock something up. I have used databases with php so I will have a look and come back.
These are the basic requirements. It is what I use to auto create a database. One of these entries in your case must be wrong.

$dbhostname = "myDomain.com";
This could be Local host or your domain name. Look at the side of your C Panel it should show you the host name. Creating the database in C panel is automatic accessing it is to use their hostname. I think this is your problem.
$dbname = "myDataBaseName";
$dbusername = "myDataBaseUsername";
$dbpassword = "myDataBasePassword";

Open a support ticket with your host and give your settings they will sort it for you.
The Guy from OZ


User 187934 Photo


Senior Advisor
20,190 posts
Online Now

I setup a mysql on my host then entered the data generated by my host into the form builder. Worked perfect. It was on BlueHost which has a mysql wizard making it pretty painless. I didn't get the time to be able to extract the data into an application yet but the table with all the data from the form submissions is there.:)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 103173 Photo


VP of Software Development
0 posts

I have found that for server name, using localhost over domain.com works better for some servers.
Learn the essentials with these quick tips for Responsive Site Designer, Responsive Email Designer, Foundation Framer, and the new Bootstrap Builder. You'll be making awesome, code-free responsive websites and newsletters like a boss.
User 187934 Photo


Senior Advisor
20,190 posts
Online Now

I'll back you on this Scott. That's what I have. "localhost" on Bluehost.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 187934 Photo


Senior Advisor
20,190 posts
Online Now

This is a great resource. You can connect to your database and set it up in a page and format it to your liking.
http://www.freewebmasterhelp.com/tutorials/phpmysql/1

This automates the display off your data outside the cpanel with just a few mouse clicks.
http://opensource.platon.sk/projects/do … NG-STARTED

I did both and it works pretty slick. Can you say "PHP is cool".:cool:

Here's a page that I made and uses data submitted from the new form builder.

<?php
$username="mysql_test";
$password="mypassword";
$database="mysql_formdata";

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM formtest";
$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close();

echo "<b><center>Database Output</center></b><br><br>";

$i=0;
while ($i < $num) {

$FirstName=mysql_result($result,$i,"FirstName");
$Lastname=mysql_result($result,$i,"Lastname");
$address=mysql_result($result,$i,"address");
$city=mysql_result($result,$i,"city");
$state=mysql_result($result,$i,"state");
$zipcode=mysql_result($result,$i,"zipcode");
$email =mysql_result($result,$i,"email");
$_submitted_ =mysql_result($result,$i,"_submitted_");
$_fromaddress_ =mysql_result($result,$i,"_fromaddress_");


echo "<b>First Name: $FirstName<br>Last Name: $Lastname</b><br> Address: $address<br>City: $city<br>State: $state<br>Zip Code: $zipcode<br>E-mail: $email<br>Date submitted: $_submitted_<br>IP address of user: $_fromaddress_<hr><br>";

$i++;
}

?>
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 464893 Photo


Ambassador
1,611 posts

Yeah! that's why I find php so useful, plus it has all been done before hardly any new ground to break. I am a member of a couple of forums and there are some brilliant members willing to help and advise. WCschools tutorials I refer too a lot. But I have noted the one you listed. Looks a great site.

One of my hosts statements
Important: MySQL Host for any database in this account is mysql14.000webhost.com , do not use localhost!

That is my point not all use Localhost. Whatever it is, is stated in the C Panel, not a problem EH!. who cares what the name provided the database accepts data. I created a classifieds on this host practice with php. Coming to grips with sessions, registrations, log ins and user maintenance was a real struggle. I have the files if anybody wants a copy. I finished with over 50 scripts. Total different method to creating a client side program. I know now why WFB creates so many scripts. Certainly makes it easier to debug.

Yes Eric that site you advised would put anybody on the right track. I wish I had some of your html skills. I have visited your site often and am blown away with what you demonstrate. One day I just know I will come knocking on your door. You are one bonza bloke, you have my admiration.
The Guy from OZ


User 236055 Photo


Registered User
51 posts

Thanks guys for all the replies some great yips

Cheers
Web Developer UK
User 236055 Photo


Registered User
51 posts

Got it working thanks guys

Phil
Web Developer UK
User 514943 Photo


Registered User
125 posts

Will one database work for all forms created with web form builder? Or does each form need it's own database?

Love those Nikon's!

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.