php and SQL.

Page may contain affiliate links. Please see terms for details.

r04DiE

300km a week through London on a road bike.
Hello all,

I dabble in web design and graphics design and I would really like to learn to make databases using SQL and php for the front end. Can anybody recommend me a book for learning this? I just want to start with a simple database, like a library list or address book or something and then move on to bigger and better things.

Thanks!
 
Last edited:

newfhouse

Resolutely on topic
I’ve knocked a few systems together over the last few years for various projects at work. I’m a hardware engineer really so as a coder I’m a self taught idiot rather than an expert. There are lots of good online resources including w3schools.com but I found the best way for me was to set up a LAMP server on an Ubuntu VM or a Pi and hack away. My code won’t win prizes, and much of it is plagiarised from online resources, but it does the job.

Sorry, not a book recommendation, but encouragement to just get stuck in.
 
OP
OP
r04DiE

r04DiE

300km a week through London on a road bike.
I’ve knocked a few systems together over the last few years for various projects at work. I’m a hardware engineer really so as a coder I’m a self taught idiot rather than an expert. There are lots of good online resources including w3schools.com but I found the best way for me was to set up a LAMP server on an Ubuntu VM or a Pi and hack away. My code won’t win prizes, and much of it is plagiarised from online resources, but it does the job.

Sorry, not a book recommendation, but encouragement to just get stuck in.
OK, thanks for that - I have MySQL workbench set up on my Mac, which should be helpful and I also have a couple of NAS boxes here at home that I can run phpMyAdmin on. Maybe I should just start dabbling but i do like the structure that a book brings.
 
Do you have any experience with other programming/scripting languages and RDBMS? That will inform any recommendations.
PHP's barrier to entry is insanely low - probably the lowest barrier to entry except maybe Python.
 
OP
OP
r04DiE

r04DiE

300km a week through London on a road bike.
Not really. I messed about with HTML a long while ago and before CMS like Joomla! and Wordpress became so popular, when I lost interest in it a bit, due to the fact that the CMS just made it all so much quicker and easier. I can get by making very simple webpages with HTML, but that's about it. I have always been really interested in databasing though, its something that I would really like to do, I love being able to automate things and manage large amounts of data.

Good to hear that php has a low entry barrier as that's what I need! Willing to put the time in and learn though.
 

si_c

Guru
Location
Wirral
I've dabbled here and there with PHP/MySQL websites for various projects. SQL I use all day every day in work so I'm fairly competent with that, but in terms of building websites I found using a framework to be very helpful in getting the structure right. Take a look at something like Laravel which should allow you to build the front end using PHP and abstracts away a lot of the database stuff you might find in a primer for PHP, plus it makes sense as it contextualises things.
 
I did wonder how long it would be before someone mentioned Laravel :whistle:

It's a fine framework, but if you're trying to learn what's going on under the hood you've no chance. I've been using PHP on and off for the best part of 20 years and I still struggle when dealing with Laravel's hand-wavy magic.

As for books, I can't recommend one for true beginners - but would say that while the fundamentals haven't substantially changed since PHP5, look for one relatively recent, as the ecosystem has come on in massive leaps and bounds with the creation and widespread adoption of things like composer and the PSR standards.
 
More helpful than my last post:
Don't worry about best practices or which framework to use as there's a lot of dogma attached to the various options.

if you're using a mac you already have apache and php installed. The best way to learn is to get stuck in.

I just skim-read this tutorial and it seems like a good jumping off point for what you want to achieve without getting mired into architectural choices.

https://www.taniarascia.com/create-a-simple-database-app-connecting-to-mysql-with-php/
 

BoldonLad

Not part of the Elite
Location
South Tyneside
Don't know what you background / expertise is, but, IMHO, there are at least two, if not three aspects to your question:

1. Database design, ie which table, relationships, columns etc
2. SQL to extract the data
3. Web coding to "drive" the SQL

I have always found the "Dummies guide" books quite a good grounding, plus, as mention above "learning from" (ie copying) code snippets from websites etc.
 
Don't know what you background / expertise is, but, IMHO, there are at least two, if not three aspects to your question:

1. Database design, ie which table, relationships, columns etc
2. SQL to extract the data
3. Web coding to "drive" the SQL

I have always found the "Dummies guide" books quite a good grounding, plus, as mention above "learning from" (ie copying) code snippets from websites etc.
Yes, for some reason I had it in my head that the OP was already up to speed with databases. Reading comprehension fail on my part.
Database design and SQL are separate subjects from PHP, even though PHP/MySQL are often lumped together.
 
OP
OP
r04DiE

r04DiE

300km a week through London on a road bike.
I've dabbled here and there with PHP/MySQL websites for various projects. SQL I use all day every day in work so I'm fairly competent with that, but in terms of building websites I found using a framework to be very helpful in getting the structure right. Take a look at something like Laravel which should allow you to build the front end using PHP and abstracts away a lot of the database stuff you might find in a primer for PHP, plus it makes sense as it contextualises things.
Great stuff, thanks for that and Laravel looks very interesting, but I think I will try to learn from the ground up, but this is defo something I might try in the future, it looks great!
 
OP
OP
r04DiE

r04DiE

300km a week through London on a road bike.
More helpful than my last post:
Don't worry about best practices or which framework to use as there's a lot of dogma attached to the various options.

if you're using a mac you already have apache and php installed. The best way to learn is to get stuck in.

I just skim-read this tutorial and it seems like a good jumping off point for what you want to achieve without getting mired into architectural choices.

https://www.taniarascia.com/create-a-simple-database-app-connecting-to-mysql-with-php/
Don't know what you background / expertise is, but, IMHO, there are at least two, if not three aspects to your question:

1. Database design, ie which table, relationships, columns etc
2. SQL to extract the data
3. Web coding to "drive" the SQL

I have always found the "Dummies guide" books quite a good grounding, plus, as mention above "learning from" (ie copying) code snippets from websites etc.
On the PHP front, this is pretty much gospel...

https://phptherightway.com/

It won't make much sense to start with but keep going back to it and you'll understand more each time.
And before going anywhere near any of the frameworks, get a good understanding of Composer/Packagist...

https://getcomposer.org/
https://packagist.org/

Just my advice.
OK, this is all golden and many, many thanks to you all for this advice - I am going to try to get stuck in. Think I might try it on my NAS first or maybe even in a directory on my website. Thanks again to you all and I really appreciate this. Might be back with more questions though!
 
OP
OP
r04DiE

r04DiE

300km a week through London on a road bike.
Book wise, I am thinking of this one.

41B39eui6QL._SX408_BO1,204,203,200_.jpg
 
Top Bottom