Reply to Problem with recorset

Your name:

Reply:


Posted by Kioto on 10/21/11 11:13

Hi all sorry for the newbie's question but i want understand the problem.
I have use a simple command with sqlite to get a data from a table.

$dbFile = realpath("./")."/data.db";

$db = sqlite_open($dbFile);

if (!(is_resource($db))) {

die("Impossibile aprire uno stream: ".
sqlite_error_string(sqlite_last_error($db)));
}

$query = "SELECT id, file, time FROM file";

$res = sqlite_unbuffered_query($db, $query);

while (list($id, $file, $time) = sqlite_fetch_array($res)) {

echo $id.$file.$time."\n";
}

I i want use a OOP to get a data from a a table i get for every execution
of loop while the first record.

include("./classdb.php");

class DbData extends SqliteDbConnect
{
function GetQueryResult($query)
{
$res = sqlite_unbuffered_query($this->dbLink, $query);
return $rows = sqlite_fetch_array($res);
}

}


$db =& new DbData("./", "data.db");

$query = "SELECT id, filem time FROM file";

while (list($id, $file, $time) = $db->GetQueryResult($query)) {

echo $id.$file.$time."\n";
}

I have tested the script with CLI on PHP4/Win.
Thanks so much to all.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация