The upgrade to PHP 5.3.0 (and possibly mysqlnd) brought some odd and annoying changes to how PHP works, especially concerning MySQL.
- mysql_close() requires a resource link identifier; without one, the script will crash on that line.
- mysql_insert_id() needs to be immediately following the mysql_query() that does the insert. If any other queries, even non-inserting queries, separate the insert query from mysql_insert_id() you’ll get a zero back as the ID.
- PHP 5.3.0 is less forgiving of blank lines at the beginning of a page. Any blank lines will now cause PHP to send headers, thus invalidating any header() functions in the page.
- getHostName() is now a built-in function; having a function of that name will fail.
- SCRIPT_URL is gone; SCRIPT_NAME seems to be its replacement. However, note that SCRIPT_NAME will sometimes contain index.php or other index filenames.
- Something changed with the way PHP stores errors in $_FILES. When the upload field name is an array (i.e., it uses square brackets), $_FILES consists of a top-level array as normal with the variable names, and then each of the pieces of info is itself an array with the index names. For example, if the form has an upload for photoOp[us] and photoOp[them], the $_FILES array will be something like:
- [us]: filename1.jpg
- [them]: filename2.jpg
- [us]: UPLOAD_ERR_OK
- [them]: UPLOAD_ERR_INI_SIZE