USD Logo MySanDiego | Libraries | Bookstore | Find People | A to Z Index | Resources | Jobs
 Prospective Students | Current Students | Alumni, Parents & Friends | Faculty & Employees | Visitors | International
About USDAdmissionsAcademicsNews and EventsAdministrationAthleticsGiving

PHP 5.3.0 Upgrade

PHP 5.3.0 Upgrade

The upgrade to PHP 5.3.0 (and possibly mysqlnd) brought some odd and annoying changes to how PHP works, especially concerning MySQL.

MySQL

  1. mysql_close() requires a resource link identifier; without one, the script will crash on that line.
  2. 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.

Other

  1. 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.
  2. getHostName() is now a built-in function; having a function of that name will fail.
  3. 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.