Location: PHPKode > scripts > QDataObject > sample.v3.mysql.php

You have to provide an existing connection
for getting a valid resource from mysql, otherwise
it will no work.
Attention: you have to switch to v.0.3


$link = mysql_connect(db_default_host, db_default_user, db_default_password) OR die(mysql_error());
if (!$link) {
    die('keine Verbindung möglich: ' . mysql_error());
mysql_select_db(db_default_database, $link) OR die(mysql_error());

$sql = "SELECT * FROM geodb_textdata"; // large db => 337925 records
$dataObject = QDataObject::getInstance('mysql',$link, $sql);

print "<pre>";
print "</pre>";
Return current item: QDataObject