 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
sutterp
Joined: 16 Apr 2008 Posts: 6 Location: Western Australia
|
Posted: Sun Apr 20, 2008 4:07 am Post subject: Already connected to the database |
|
|
I need to do some pre-processing in my program. This pre-processing connects to the database via an include file and returns the MySQL link identifier as a global variable.
| Code: | | $dbConnect = mysql_connect($dbserver,...) |
As I am already connected to the database when invoking datagrid->bind. What do I need to specify as the $options argument to re-use this connection? Specifying the MySQL link identifier results in:
| Code: | Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /usr/share/php5/PEAR/Structures/DataGrid.php on line 1466
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /usr/share/php5/PEAR/Structures/DataGrid/DataSource.php on line 155
No Database object or dsn string specified |
|
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1011
|
Posted: Sun Apr 20, 2008 10:33 am Post subject: |
|
|
Reusing such native database connections isn't possible in Structures_DataGrid. This would require that we have special code for every of the databases that PHP supports.
You didn't write it, but it seems that you want to use a SQL query in the bind() call. This works only in conjunction with PDO (not available on PHP 4) or the PEAR packages DB (deprecated) and MDB2. For MDB2 you'll find some details here:
http://pear.php.net/manual/en/package.structures.structures-datagrid.structures-datagrid-datasource.mdb2.php
If you have further questions on this, don't hesitate to ask. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|