PHP-Nuke: Management and Programming
Prev | Chapter 11. Programmer's tools | Next

# The syntax of SQL code

Aiming at making PHP-Nuke compatible with more databases, the SQL syntax has been transformed to functions, in order to achieve a standard syntax that is independent of the database used. For convenience, let us recall the file sql_layer.php in a somewhat cleaned-up version:

    sql_connect($host, $user, $password, $db)
    sql_logout($id)
    sql_query($query, $id)
    sql_num_rows($res)
    sql_fetch_row(&$res, $nr)
    sql_fetch_array(&$res, $nr)
    sql_fetch_object(&$res, $nr)
    sql_free_result($res)

  Log into the DB.
  Disconnect from the DB.
  Query.
  Number of Rows.
  Fetch Rows.
  Fetch Array.
  Fetch Object.
  Free Result.

With this syntax you will be able to render all the modifications, blocks or modules you create compatible to all the databases supported by PHP-Nuke, which are:

- MySQL

- mSQL

- PostgreSQL

- PostgreSQL_local

- ODBC

- ODBC_Adabas

- Interbase

- Sybase

Prev | Home | Next
Programmer's tools | Up | PHPMyadmin, administering MySQL via web