Problem with rlib_add_datasource_mysql (PHP)
"Evan Gates" <[email protected]> Thu, 23 Feb 2006 15:42:33 -0700
| Newsgroups | gmane.text.rlib.user |
|---|---|
| Message-ID | <[email protected]> |
Hi I just started using rlib and it looks great, but I'm having a
problem running some of your example code:
<?php
dl ("rlib.so");
$hostname = "localhost";
$username = "user";
$password = "mypass";
$database = "mydb";
$rlib = rlib_init();
rlib_add_datasource_mysql($rlib, "local_mysql", $hostname,
$username, $password, $database);
rlib_add_query_as($rlib, "local_mysql", "SELECT * FROM USERS",
"products");
rlib_add_report($rlib, "test_format.xml");
rlib_set_output_format_from_text($rlib, "pdf");
rlib_execute($rlib);
header(rlib_get_content_type($rlib));
rlib_spool($rlib);
rlib_free($rlib);
?>
I'm not getting any output at all (including error output), but the
functions rlib_add_datasource_mysql and rlib_execute are returning -1.
When I echo out rlib_get_content_type($rlib) it prints out "UNKNOWN."
Looking at the C I can see that rlib_add_datasource_mysql will return
-1 in two cases: g_module_open failing or not connecting to the
database. I've checked the database variables using PHP's mysql
functions and it works fine, so I'm assuming the problem is with
loading the module.
A quick search shows that I have the following files:
/usr/local/lib/libr-mysql.la
/usr/local/lib/libr-mysql.so
Does anyone know any reasons why this function might be failing?
Thanks in advanced.
-Evan
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642