Coding with SPIP 2.1
SPIP 2.1 Technical Documentation

> > > > sql_showbase

sql_showbase

The sql_showbase() function is used to obtain a resource that can be used with sql_fetch() detailing the tables that exist in the database.

It accepts 3 parameters:

  1. $spip empty by default, the parameter is used to list only the tables using the prefix defined for SPIP tables. Use '%' instead if you want to list ALL tables,
  2. $serveur,
  3. $option.

Usage:

  1. if ($q = sql_showbase()) {
  2. while ($t = sql_fetch($q)) {
  3. $table = array_shift($t);
  4. // ...
  5. }

Download

The sql_alltable function is generally easier to use, since it directly returns a PHP array listing the various database tables.

  • Author :
  • Published :
  • Updated : 02/06/10
  • Translations : English, français