Solved

WordPress HTTP POST form with MySQL relational database support.

Posted on 2013-11-15
7
1,238 Views
Last Modified: 2013-11-15
I'm new to WordPress. I have some PHP and MySQL experience. My client uses 1and1 hosting and running WordPress software on the hosting site. She wants me to develop a form where users can submit images with a large amount of image metadata. So this form would need a relational database (tell me if there is a better way) that contains several tables, because certain fields like "tags" will have multiple entries. So I'm thinking multiple tables for normalization purposes.

Data will be submitted by several hundreds of people with possible large image files. Some other people will have the ability to query the DB via another form I will create and look for images with a specific tag name, location, image subject, etc.

I know how to design this database and write the php code if I created a non-WordPress plain php site talking to a MySQL DB on the hosting site. However, I'm having issues with how to implement such page/db on WordPress. I looked into contactForm7 and Contact DB plugin and set up a small form. This is when I realized that the form is saved on WordPress in one large unmodifiable single table.

Questions:
1. Can I implement my conceptual db and form using WordPress? Am I using the right plugins?
2. What's the difference between using WordPress DB vs. MySQL DB on the hosting service?

Please tell me how should I proceed.
0
Comment
Question by:alexmac05
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 400 total points
ID: 39652793
1. Can I implement my conceptual db and form using WordPress?

Yes.  First off, remember that WordPress is just php and mysql...so if you can solve the issue in php and mysql, you can do whatever needs doing in WordPress.  When people talk about developing a solution "in WordPress" what they typically mean is that they need a solution that takes advantage of the WordPress framework to automate certain tasks...in your case it would be taxonomies (metadata).  But you can also just use custom templates to get your own code and systems to display in a WordPress site so that the look and feel is consistent across the site and the app.

In this specific instance, I could make an argument that you could do what you want either way since you have the requisite PHP skills. But WordPress provides all the systems you need to be successful with just a plugin or two so that' she solution I will detail below.

2. Am I using the right plugins?

No.  Contact Form 7 is a great, free plugin for simple operations but for you want to do with file uploads and taxonomy creation I would urge you to step up to Gravity Forms or Formidable Pro.  These are best-in-class form plugins for WordPress and while not free, provide a ton more functionality plus support for not a lot of money.  

What I would do here is to use a Custom Post Type and Custom Fields to define every type of taxonomy you will need.  WordPress automatically supports two kinds of taxonomies (categories and tags) but you can add more via custom post types and fields.

Either Gravity or Formidable will create a form that will create a new post on submission and populate the various taxonomies with the form contents.  Both plugins will allow image uploads and you can create thumbnails for uploads using some additional code.  By using custom posts, you automatically hook into the WordPress search, browse, navigation and display functions and you can further extend any or all of those with other plugins as needed.

The other way to do it is to write your own thing and just wrap the code in custom page templates.  There's nothing wrong with this solution and it may be easier for you.

3. What's the difference between using WordPress DB vs. MySQL DB on the hosting service?

It's all mysql.  Not sure what you are asking here.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39652856
Some hosts don't give you access to the database (or even the code!) for their Wordpress installs.
0
 

Author Comment

by:alexmac05
ID: 39652892
Jason,

Excellent response, thank you! To clarify my second question: Is there a space limitation of using a WordPress DB versus the regular MySQL db on my hosting server? I have unlimited storage on my hosting site. The reason why I'm asking because when I tried add an image upload to my form using Contact form 7, there was a size limitation for the file upload. Also, how is support for relational database if I use the DB on WordPress, or can I get away in my instance with not using one? I haven't seen a single example or demo of a WP relational DB. I heard the use of relational databases are "going out of style".
0
Do you have a plan for Continuity?

It's inevitable. People leave organizations creating a gap in your service. That's where Percona comes in.

See how Pepper.com relies on Percona to:
-Manage their database
-Guarantee data safety and protection
-Provide database expertise that is available for any situation

 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 100 total points
ID: 39652896
There is no "WordPress DB".  Wordpress uses MySQL.  Wordpress may however use a different copy of MySQL than the one that you have access to.  That depends on the host.

Relational database are Not going out of style.  That rumor goes around every now and then started by people who have nothing better to do.

And limits on file upload size have nothing to do with the database.  That restriction is set by the hosting in 'php.ini'.
0
 
LVL 70

Assisted Solution

by:Jason C. Levine
Jason C. Levine earned 400 total points
ID: 39652907
DaveBaldwin is completely correct on all points.  Most shared hosting restricts uploads to a few megabytes as a security measure.  If you allow unlimited uploads it's very easy to bring a server down with a simple automated script to upload massive files.  The result is a DoS attack.

There are ways around the limit.  You can add a "chunking" upload script that uploads huge files a little bit at a time or you can leverage AWS or another cloud storage service with an upload API and send the file there and bypass the site and server altogether.
0
 
LVL 70

Assisted Solution

by:Jason C. Levine
Jason C. Levine earned 400 total points
ID: 39652910
I haven't seen a single example or demo of a WP relational DB.

No idea what you are looking at.  WordPress runs on MySQL and is relational. Just look at how the wp_posts and wp_terms tables interact...

If you are talking about a form plugin creating relational records, then yes...those are few and far between.  I think Formidable is the only one that kinda/sorta does it but it's not creating true parent/child relationships...it fakes it a little bit.

If you are looking to build your own tables, it's all in MySQL and thus relational.
0
 

Author Closing Comment

by:alexmac05
ID: 39652921
Thank you so much for proving these excellent responses! It helped me so much!
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question