Error eZMySQLDB

Author Message

César Camelo

Monday 16 January 2006 6:58:47 am

Hi! I have to fetch data from other database called "corral_cmadbprod", when I get the data. I've got an error: Error: eZMySQLDB.

Here's the SQL debug output (when I see the fetched data)

--------------------------------------------------------------------------

Notice: eZMySQLDB::query(0.000 ms) query number per page:0 Jan 16 2006 09:26:23

SET NAMES 'latin1'

Error: eZMySQLDB Jan 16 2006 09:26:23

Query error: Table 'corral_cmadbprod.ezcontentobject_tree' doesn't exist. Query: SELECT ezcontentobject.*,
ezcontentobject_tree.*,
ezcontentclass.name as class_name,
ezcontentclass.identifier as class_identifier
, ezcontentobject_name.name as name, ezcontentobject_name.real_translation
FROM ezcontentobject_tree,
ezcontentobject,
ezcontentclass
, ezcontentobject_name
WHERE node_id IN ( 359 ) AND
ezcontentobject_tree.contentobject_id=ezcontentobject.id AND
ezcontentclass.version=0 AND
ezcontentclass.id = ezcontentobject.contentclass_id
and ezcontentobject_tree.contentobject_id = ezcontentobject_name.contentobject_id and
ezcontentobject_tree.contentobject_version = ezcontentobject_name.content_version and
ezcontentobject_name.content_translation = 'esl-CO'

Notice: eZMySQLDB::query(0.000 ms) query number per page:1 Jan 16 2006 09:26:23

SELECT ezcontentobject.*,
ezcontentobject_tree.*,
ezcontentclass.name as class_name,
ezcontentclass.identifier as class_identifier
, ezcontentobject_name.name as name, ezcontentobject_name.real_translation
FROM ezcontentobject_tree,
ezcontentobject,
ezcontentclass
, ezcontentobject_name
WHERE node_id IN ( 359 ) AND
ezcontentobject_tree.contentobject_id=ezcontentobject.id AND
ezcontentclass.version=0 AND
ezcontentclass.id = ezcontentobject.contentclass_id
and ezcontentobject_tree.contentobject_id = ezcontentobject_name.contentobject_id and
ezcontentobject_tree.contentobject_version = ezcontentobject_name.content_version and
ezcontentobject_name.content_translation = 'esl-CO'
------------------------------------------------------------------------

It seems like eZ is trying to do something with the other database. I really don't know!!
Any Ideas?

Łukasz Serwatka

Friday 20 January 2006 2:26:49 am

Hi Cesar,

You will need to force new instance when you want to connect to external database from your module/script

Example code can look:

$dsn = array(
'server'        => 'localhost' ),
'user'          => 'db_usr' ),
'password'      => 'passwd' ),
'database'      => 'external_db' ),
);

$extdb =& eZDB::instance( 'ezmysql', $dsn, true  );
$extdb->arrayQuery( ... )

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

César Camelo

Monday 23 January 2006 1:39:04 pm

Thank so much, that solved my problem!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:27:54
Script start
Timing: Jan 18 2025 19:27:54
Module start 'layout'
Timing: Jan 18 2025 19:27:54
Module start 'content'
Timing: Jan 18 2025 19:27:54
Module end 'content'
Timing: Jan 18 2025 19:27:54
Script end

Main resources:

Total runtime0.0151 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 589.2109152.6094
Module start 'layout' 0.00550.0030 741.820339.3984
Module start 'content' 0.00850.0046 781.218893.3828
Module end 'content' 0.01310.0019 874.601634.3047
Script end 0.0150  908.9063 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002315.3601140.0002
Check MTime0.00106.9417140.0001
Mysql Total
Database connection0.00085.498410.0008
Mysqli_queries0.002617.272930.0009
Looping result0.00000.113810.0000
Template Total0.001510.010.0015
Template load0.00085.556910.0008
Template processing0.00074.402810.0007
Override
Cache load0.00063.674010.0006
General
dbfile0.00021.465580.0000
String conversion0.00000.055340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs