The only database tables you’ll ever need

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

Hack Culture Needs to Die

Anybody else tired of “hack” culture? “7 Hacks to Triple Your…” “A Secret Hack to Instantly Double Your…” “52 Little-Known Hacks to…” I asked my

Read More »
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.

The simple secrets to high-paying freelance clients

What makes clients willing to pay $5,000, $10,000 even $20,000 and up for your services? Download and install my mobile app and I’ll show you. It’s free. Just click the button below:

Clients Like:

Inc. Magazine Logo
Lewis Howes Logo
Ray Edwards Logo

WHAT OTHERS ARE SAYING

Jim DeJonge

Jim DeJonge

John has a relaxed and engaging manner. His advice is solid and the explanations are well thought out.

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.

Jason Rumley

Jason Rumley

John has a habit of over-delivering on the expectations he sets up. That’s why he’s the best.

Bradley Smith

John and I have worked together on numerous projects. John is very quick and efficient and was a pleasure to work with.

Aaron Gott

Aaron Gott

John has a particular knack for the development and training of others.

Michael Skye

Michael Skye

John is a man of integrity, who gives generously of himself to projects and people he cares about.

Steve Dimmick

Steve Dimmick

John has provided expert knowledge and advice on multiple occasions that have helped me better serve my clients. John is a Rockstar!

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.

Andrew Malone

Andrew Malone

John Morris is exceptional in his ability to give focused insight into Freelancing and starting one’s business. His direct methods inspire confidence in his honesty.

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!

Daniel Mohlendick

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

Xan Barksdale

Xan Barksdale

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

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.