PHP Programming/PostgreSQL

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

[edit] PostgreSQL

PostgreSQL is another popular database used with PHP.

The basic syntax of PostgreSQL is the same as that of MySQL, although some functions have been renamed:

  • mysqli_connect becomes pg_connect
  • mysql_select_db is deprecated; it is specified in the pg_connect syntax
  • mysqli_query becomes pg_query
  • mysql_error becomes pg_last_error
  • mysql_close becomes pg_close
  • mysql_fetch_assoc becomes pg_fetch_assoc
  • mysql_free_result becomes pg_free_result

[edit] For More Information