The sql_query() function executes the query passed to it as a parameter. It is the least portable of the SQL instruction command set; it should therefore be avoided wherever possible in preference to the other more specific SQL API functions.

It accepts 3 parameters:

  1. $ins is the SQL query,
  2. $serveur,
  3. $option.


  1. $res = sql_query('SELECT * FROM spip_meta');
  2. // but we would prefer you used this instead:
  3. $res = sql_select('*', 'spip_meta');


Author Mark Baber Published : Updated : 02/06/10

Translations : English, français