The only database tables you’ll ever need

DISCLAIMER: This post may contain “affiliate” links to products and services I recommend. I’ll receive a small commission if you decide to purchase one of these products or services. I only recommend products I genuinely believe will help you in running your freelance business.

Awhile back, Sam messaged me about a database problem he’d been struggling with for a bit:

“I’m building this app… like basecamp for lawyers. The probelm im having is attaching clients to cases after their lawyer set up their case… But looking at my database tables, it occured to me that I have no idea what column to put that CaseID variable in. The client should only see the case the lawyer has “attatched him to” I was thinking that maybe I could insert the case ID in the client_register table by adding a new column….and then do some weird quadrupal inner join or something….but that doesnt seem right when I say it outloud.”

Sounds complicated…

But, the solution is pretty simple.

So, I told him and about and a few weeks later he sent me this:

“Hey thanks again for the help with join table, it worked perfectly.”

Within a month, he had completed his app, entered it into a competition and began running it as a cloud-based service. Eventually, he was even featured on USA Today. And, now also runs a coding bootcamp.

What did I show him?

Well, there’s only three types of database tables you’ll really ever need.

When you use these…

It keeps your database uber-flexible and scalable.

And, allows you to easily add new functionality to your app…

Without constantly re-structuring your database.

In fact, WordPress does this and has had basically the same database structure for years now. Through all its different iterations and feature enhancements, the database structure has remained largely the same.

In fact, a little while after I’d explained it to Sam…

He sent me this out of the blue:

“Thanks again by the way, explaining the r____________ tables has helped me on a ton of other projects.”

Which is the best part…

You can use this setup for any application.

Doesn’t matter what it does.

The setup is so flexible… it can handle virtually anything.

And, make your coding life about 1000 times easier.

Anyway, I show you how to do it step-by-step in Module 3 of PHP 101. Along with all the things you’d expect like CRUD, PDO, MySQLi, prepared statements, input filtering, prevent SQL injection attacks, output escaping and more.

If you want to get MySQL handled, this is how: http://johnmorrisonline.com/php

Later,

John

You might also like

Do you want more freelance clients?

I’ll show you what I learned over the last 15 years to grind out (from absolute scratch) a backlog of new clients wanting to hire you. Who your best client prospect are, what services you should be offering them, where to find them and more. Just enter your email address in the box below and let’s get started:

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on reddit
Reddit
Share on pinterest
Pinterest
John Morris

JOHN MORRIS

I’m a 15-year veteran of freelance web development. I’ve worked with bestselling authors and average Joe’s next door. These days, I focus on helping other freelancers build their freelance business and their lifestyles.

Do you want more freelance clients?

Enter your email below to get started building your system for consistently bringing in new freelance clients:

WHAT OTHERS ARE SAYING

Daniel Mohlendick

On the Freelancing on Upwork course: “This is by far the best course i have watched on Skillshare!! Thank you so much.”

Sukh Plaha

John is a fantastic and patient tutor, who is not just able to share knowledge and communicate it very effectively – but able to support one in applying it. However, I believe that John has a very rare ability to go further than just imparting knowledge and showing one how to apply it. He is able to innately provoke one’s curiosity when explaining and demonstrating concepts, to the extent that one can explore and unravel their own learning journey. Thanks very much John!

Ray Edwards

I recommend John every chance I get. If every person I worked with were as committed to excellence, punctuality, value, and unquestionable integrity… the world would be a better place. Highest recommendation.

Bob Patterson

Not only is John a very talented programmer and developer, he is also an excellent communicator. He has a talent for taking complex subjects and communicating them in terms that anyone can understand. This is a rare combination. This ability has enabled me to take my skills and knowledge to the next level. Thank you John for for all that you do.

Chris Aitken

He significantly improved my site through his expert knowledge of PHP, CSS and Javascript. Would definitely recommend John to others.

Lewis Howes

John is amazing at building membership sites. He converted one of my sites over from it’s existing (hardly working) platform over to the clean and simple to use WishList membership platform. I highly recommend using John and WishList for any of your membership site needs.

Xan Barksdale

Xan Barksdale

Very professional worker who is extremely knowledgable in WordPress and Wishlist Member. I would definitely hire again.

Close Menu