June 2010
Intermediate to advanced
328 pages
7h 51m
English
How can I tell what I think till I see what I say?
A PHP programmer asked for help troubleshooting the confusing result of a seemingly straightforward SQL query against his library database:
| Implicit-Columns/intro/join-wildcard.sql | |
| | SELECT * FROM Books b JOIN Authors a ON (b.author_id = a.author_id); |
This query returned all book titles as null. Even stranger, when he ran a different query without joining to the Authors, the result included the real book titles as expected.
I helped him find the cause of his trouble: the PHP database extension he was using returned each row resulting from the SQL query as an associative array. For example, he could access the Books.isbn column as $row["isbn"] ...
Read now
Unlock full access