SQL-relay PHP module

PHP API


USING

You can use the module by loading it in your PHP script and calling SQL Relay functions.

For example:

dl("sql_relay.so");
$con=sqlrcon_alloc("adasz",9000,"","user1","password1",0,1);
$cur=sqlrcur_alloc($con);
sqlrcur_sendQuery($cur,"select table_name from user_tables");
sqlrcon_endSession($con);
for ($i=0; $i<sqlrcur_rowCount($cur); $i++)
{
  printf("%s\n",sqlrcur_getField($cur,$i,"table_name"));
}
sqlrcur_free($cur);
sqlrcon_free($con);

An alternative to running dl(sql_relay.so) is to put a line like:

extension=sql_relay.so

In your php.ini file. Doing this will improve performance as the library isn't loaded and unloaded each time a script runs, but only once when the web-server is started.


FUNCTIONS

If you don't need to use substitution or bind variables in your queries, use these two methods.

If you need to use substitution or bind variables, in your queries use the following methods. See the API documentation for more information about substitution and bind variables.


AUTHOR

Adam Kropielnicki
adasz@wp.pl