We work a lot with MySQL and PHP. WEll, not as much as we’d like, but we are learning. And we are getting better. But in the mean time, we use a lot of references, including many online ones. Here are some handy things we recently came across to help us with a trouble ticket application we are building, some of which is embarrasingly simple and basic, but it helps to write it out:
MySQL manual on INSERT.
A very nicely laid out set of things you can do with your records from the Institute for Information Systems and and Computer Media. Includes some easy examples.
FAQTS has some good PHP FAQs going, including this nice reminder on how to access the last record in a table. Note: the queries on this page have a type. It should read “mysql_query” instead of what’s lsited.
Computing dot net helped clarify that one should use mysql_num_rows, and not mysql_numrows.
We learned a bit about the necessity of using mysql_fetch_row for this early part of the project. PHP Addict helped us crack through the maddness in their help forum. The good folks at Zend (the PHP folks themselves) had many good examples for it. But it was Larry Ullman (whose PeachPit books are nice) who empahsized that it (or something like it) is always needed: “What you are printing is just a resource ID. You ALWAYS have to use mysql_fetch_array() to access the actual returned information“. For good measure, here is the PHP manual entry on mysql_fetch_array().
Leave a Reply