php - displaying sqlite records return error -
i have code displaying records sqlite.
class mydb extends sqlite3 { function __construct() { $this->open('database.sqlite'); } } $db = new mydb(); if(!$db){ echo $db->lasterrormsg(); } else { echo "opened database successfully\n"; } $sql =<<<eof select * database_table_column; eof; $ret = $db->query($sql); while($row = $ret->fetcharray(sqlite3_assoc) ){ echo "database id = ". $row['id'] . "\n"; echo "database name = ". $row['database_name'] ."\n"; echo "column name = ". $row['column_name'] ."\n"; } echo "operation done successfully\n"; $db->close();
and got following error (refer below) 1. warning: sqlite3::query(): unable prepare statement: 1, no such table: database_table_column 2. fatal error: call member function fetcharray() on non-object
i'm sure have database.sqlite file , created database_table_column table id column, database_name column , column_name column why doesnt work? ideas, suggestions, recommendations , appreciated. thank you.
Comments
Post a Comment