Path

ez.no / exponential / documentation / development / libraries / ez db / data retrieval


Data retrieval

These documentation pages are no longer maintained. Please visit the new documentation site.

To fetch data from the database you can use the arrayQuery function. This function takes an SQL command as a parameter. An array of associative arrays is returned.

 // fetch some data into an array of associative arrays

 $rows =& $db->arrayQuery( "SELECT * FROM sql_test" );

 

 foreach ( $rows as $row )

 {

    print( $row["name"] );

 }

Comments

Query not working!!

When I do this:

//get db-connection
$db =& eZDB::instance();
...
//this is the line its refering to, line 84
$rows = $db->arrayQuery( "SELECT * FROM ezcontentobject_tree WHERE parentnode_id = $parentnodeid" );
...etc

and the output when I run it is:
Fatal error: Call to a member function on a non-object in /data/exponential/3.2-1/met_imp_final.php on line 84<br />
Fatal error: Exponential did not finish it's request
The execution of Exponential was abruptly ended.

Whats wrong?!?
claÜs

log in or create a user account to comment.

Contents

Development

Extensions
Exponential datamodel
Exponential tuning and stability
Importing attribute data
Kernel
Libraries
    eZ xml
    eZ db
       Data retrieval
       Data storage
    eZ i18n
    eZ soap
    eZ template
    eZ webdav
Scripting
Standards
System overview
Test Suite
Using Doxygen to create API documenta...


Created

04/07/2003
10:39:27 am
by Bård Farstad

Last updated

04/07/2003
10:39:27 am
by Bård Farstad

Authors

Bård Farstad



This page is part of the Exponential documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.