explaination needed for "WHERE" command
Posted: Sat Oct 03, 2009 1:05 pm
Two tables in the database:
01. "entries". which includes the following fields: "id", "cat_id", "dateposted", "subject", "body"
02. "categories", which includes: "id", "cat"
now this query:
"SELECT entries.*, categories.cat FROM entries, categories
WHERE entries.cat_id = categories.id
..."
(It's taken from the book Practical PHP and Mysql by Jono Bacon, chapter 4)
can somebody give me a detailed explantion of what the WHERE is doing?
it's explained in the book, but not detailed enough for me to fully understand what is going on here.
thanks
01. "entries". which includes the following fields: "id", "cat_id", "dateposted", "subject", "body"
02. "categories", which includes: "id", "cat"
now this query:
"SELECT entries.*, categories.cat FROM entries, categories
WHERE entries.cat_id = categories.id
..."
(It's taken from the book Practical PHP and Mysql by Jono Bacon, chapter 4)
can somebody give me a detailed explantion of what the WHERE is doing?
it's explained in the book, but not detailed enough for me to fully understand what is going on here.
thanks