lec-php-07
A user goes to hello.php for the first time.
hello.php
views including controllers, instead of the other way around
I'm totally guilty of not doing this, and I should know better.
It works the same as exit...but sends a slightly different message to the reader.
◉ How do I connect to a database?
◉ How do I query the database?
◉ What form do the results take?
◉ What's a prepared statement - and why should I use them?
◉ Can we clean this up at all?
Then we can have a civilized conversation.
Remember how we did that last week?
It's easier to troubleshoot problems if you do.
Trust me. I've been there.
Build a query that returns the names of all cheeses in the DB.
Let's try some variants, too - to get those SQL juices flowing again after a (long?) absence.
Say we want to display a list of the cheeses we sell in a view.
What data type is it?
Maybe $result isn't such a great name.
You would expect the results of the query, like you would see if you were in COMP2521, right?
No such luck.
3-results/foreach.php
3-results/fetch.php
3-results/fetchAll.php
3-results/view.php
I think you should be summarizing what's been covered now.
And we want the results in alphabetical order.
This will guide our choices of what query we need to build.
'cuz it's a bit of a dumpster fire.