October 2022
Intermediate to advanced
380 pages
9h 35m
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:
| | 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.
The cause of his trouble was that 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"]. In ...
Read now
Unlock full access