From: Evan G. <ve...@gm...> - 2006-02-23 22:42:36
|
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 =3D "localhost"; $username =3D "user"; $password =3D "mypass"; $database =3D "mydb"; $rlib =3D 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 |