Return to Snippet

Revision: 20342
at November 12, 2009 18:20 by mviera


Initial Code
<?php

if (!$bd = new SQLiteDatabase('database.sqlite', 0666, $error))
    die($error);
$sql = "SELECT * FROM table_name";
$data = $db->query($sql);
$data_count = $data->numRows();
if ($data_count != 0) {
    for ($i=0; $i<$data_count; $i++) {
        echo "$data->fieldName($i)";
    }
    while ($tuple = $data->fetch()) {
        echo "$tuple['name']<br>";
        echo "$tuple['description']<br>";
        echo "$tuple['prize']<br>";
    }
}
unset($bd);

?>

Initial URL

                                

Initial Description

                                

Initial Title
How to use the SQLite Objetct Oriented Interface

Initial Tags

                                

Initial Language
PHP