This page hopefully will show you how to display selected data submitted via FormBuilder to a MySQL Database. You must have already created your database on your server and used Formbuilder once to build the the Table and Field names.
Below is the form which will add information to the database and further down the page will be the actual PHP Code you will need to show selected content within a table on a web page.
When you fill in the Form and Submit it, you will come back to this page and see your Submission in the Table below, your email address will not be shown, if you do not want your real name to show just enter a nickname.
Here are the results of the User submitted data.
| Name | First Choice | Second Choice | Third Choice |
|---|---|---|---|
| Darce | Ad Producer | Ad Producer | Ad Producer |
| Darce Jean | Ad Producer | Ad Producer | Ad Producer |
| Mike | Ad Producer | Firestarter | Pix Converter |
| me | Ad Producer | Ad Producer | Ad Producer |
| Lee8-11-10 | Ad Producer | Ad Producer | Ad Producer |
| Me Smith | Ad Producer | Ad Producer | Ad Producer |
| FERNANDO GONZALEZ | Ad Producer | Ad Producer | Ad Producer |
| simon | Ad Producer | Cart Creator Pro | Flash Blogger |
| Dennis | Cart Creator | Cart Designer | Cart Designer Pro |
| rt | Cart Creator | Cart Designer Pro | Ad Producer |
| levent | Cart Creator | Cart Creator Pro | Cart Designer |
| a | Cart Creator | Cart Creator Pro | Cart Designer |
| fredddy | Cart Creator | Photo Gallery | Web Jukebox |
| Bruce | Cart Creator | Cart Designer Pro | Cart Designer |
| gene | Cart Creator | Cart Designer Pro | Image Mapper |
| Andrea | Cart Creator Pro | Cart Designer Pro | Live Chat |
| Agnieska_r | Cart Creator Pro | Cart Designer | Ad Producer |
| blahblahblah | Cart Creator Pro | Cart Designer Pro | Gif Animator |
| f | Cart Creator Pro | Cart Designer Pro | Cart Designer Pro |
| Sharon | Cart Creator Pro | Cart Designer | Ad Producer |
| ME | Cart Creator Pro | Cart Designer | Cart Designer Pro |
| dfsfsdf | Cart Creator Pro | Cart Designer Pro | Gif Animator |
| Kev | Cart Creator Pro | HTML Editor | Cart Designer Pro |
| apple | Cart Creator Pro | Direct FTP | Web Access Manager |
| Wilson | Cart Creator Pro | Cart Designer Pro | Firestarter |
| asa | Cart Creator Pro | StyleSheet Maker | Ad Producer |
| Fred Frog | Cart Creator Pro | Cart Designer | Flash Blogger |
| scott r | Cart Creator Pro | Cart Designer | Do Not have One |
| Lee | Cart Designer | Cart Designer | Direct FTP |
| sadfsd | Cart Designer | Live Chat | Do Not have One |
| dfsfsf | Cart Designer | Cart Designer Pro | Cart Designer |
| skatopoulos | Cart Designer | Cart Creator Pro | Do Not have One |
| someones first name | Cart Designer | Color Schemer | Gif Animator |
| sdfsdf | Cart Designer | Cart Designer Pro | Ad Producer |
| Ken | Cart Designer | Color Schemer | MP3 Rip & Burn |
| judge | Cart Designer Pro | Direct FTP | Do Not have One |
| Pete N | Cart Designer Pro | Photo Gallery | Do Not have One |
| Lee | Cart Designer Pro | Cart Creator Pro | Ad Producer |
| dsfdsf | Cart Designer Pro | Cart Designer | Ad Producer |
| test | Cart Designer Pro | Cart Creator | Cart Designer Pro |
| dominic | Cart Designer Pro | Form Builder | VSD |
| pete | Direct FTP | Pix Converter | HTML Editor |
| A Carter | Firestarter | MP3 Rip & Burn | Do Not have One |
| Allen | Firestarter | Do Not have One | Do Not have One |
| test | Form Builder | Ad Producer | Ad Producer |
| Lloyd | Form Builder | Cart Designer | Website Font |
| Matt | Form Builder | HTML Editor | Ad Producer |
| lucky | Form Builder | Direct FTP | Live Chat |
| GG | HTML Editor | Form Builder | Do Not have One |
| Paul | HTML Editor | Photo Gallery | Sitemapper |
| Jack | HTML Editor | Web Access Manager | Sitemapper |
| Lewis | HTML Editor | Form Builder | Do Not have One |
| Thomas | HTML Editor | Form Builder | Sitemapper |
| Jo Ann | HTML Editor | Color Schemer | Form Builder |
| Laura | HTML Editor | Flash Website Search | Do Not have One |
| Dick | HTML Editor | Web Access Manager | Form Builder |
| Carlos | HTML Editor | Form Builder | Do Not have One |
| Abe | HTML Editor | Form Builder | Sitemapper |
| Jim | HTML Editor | Form Builder | Sitemapper |
| Mark | Live Chat | HTML Editor | Web Access Manager |
| Don | Password Wizard | Cart Designer Pro | Web Access Manager |
| Joe | RSS News Flash | Sitemapper | Do Not have One |
| Chris | VSD | Sitemapper | Photo Gallery |
| Bubba | VSD | Cart Creator Pro | Cart Designer Pro |
| DTG | VSD | HTML Editor | Form Builder |
| Mark | VSD | Form Builder | Web Access Manager |
| David T | VSD | HTML Editor | Cart Designer Pro |
| Mike | VSD | Cart Creator | Cart Designer |
| jackie | VSD | Cart Creator Pro | Flash Menu Builder |
Please Note: When you have created your page, save your page with the .PHP extension.
If your server supports the .htaccess file, and depending what version of PHP your server is running, you can add a line into the .htaccess file which will allow you to carry on using the .html file format and run php and 'include' from within your page.
For php 5 just add this line:- AddHandler application/x-httpd-php5 .html .htm
For previous version use:- AddHandler application/x-httpd-php .html and AddHandler application/x-httpd-php .htm
Some Apache servers are already configured to do this, so please check first.
Here is how to edit the code you will need to add to your page in order to display it on your page.
There are a few things you will have to change to match the code to your own database settings, start from the top of the code and where you see "yourinfo" (there are 3 of these) change this to your own info, next look for "tablename in this line:-
$result = mysql_query("SELECT * FROM tablename ORDER BY First",$dbcon);
" change this to to name of your Table, next after "ORDER BY" change First with the Fieldname you would like the data sorting by.
Finally you will need to change the strings below to match your own Fieldnames:
// load to vairables
$field1 = $arow["yourfield"];
$field2 = $arow["yourfield"];
$field3 = $arow["yourfield"];
$field4 = $arow["yourfield"];
// -------------------------- display data
// output rows
echo "<tr><td>$field1</td><td>$field2</td><td>$field3</td><td>$field4</td>";
That is it, below is the full code to be edited.
If you want the CSS code for the table display, here it is, you can leave the scroll box section out if you want.