This post was last edited by Dlebh on 2013-09-17 14:28:12
php + SQLite
Field titles are indexes!
$sql = "Select * from Fang where titles in (' Kill ')"; $result = $dbh->query ($sql); $r = $result->fetchall ();
Return error: Fatal Error:call to a member function Fetchall () on a non-object in
There are no errors in the statement that can be performed normally but cannot be run in PHP.
What's the reason, please, thank you for your advice.
Reply to discussion (solution)
Which Daniel can instruct twos ah ....
The support! Maybe you wrote it wrong.
Print_r ($DBH->errorinfo ());
Let's see what's wrong.
Oh, okay, I'll try.
Array ([0] = HY000 [1] = 1 [2] = no such column:titles)
Out of this error
The support! Maybe you wrote it wrong.
Print_r ($DBH->errorinfo ());
Let's see what's wrong.
Array ([0] = HY000 [1] = 1 [2] = no such column:titles)
Out of this error
No such column:titles
There is no such column: titles
You wrote the wrong thing, the machine won't lie to you.
$a = $dbh->query (' SELECT * from Sqlite_master ');p rint_r ($a->fetchall (PDO::FETCH_ASSOC));
Compare SQL Columns
No such column:titles
There is no such column: titles
You wrote the wrong thing, the machine won't lie to you.
$a = $dbh->query (' SELECT * from Sqlite_master ');p rint_r ($a->fetchall (PDO::FETCH_ASSOC));
Compare SQL Columns
Fatal Error:call to a member function Fetchall () on a non-object
Or is it a mistake to explode?
My SQL statement is fine. You can perform the display results in SQLite
It's the end of the PDO, isn't it? Does PDO not support indexed columns?
No such column:titles
There is no such column: titles
You wrote the wrong thing, the machine won't lie to you.
$a = $dbh->query (' SELECT * from Sqlite_master ');p rint_r ($a->fetchall (PDO::FETCH_ASSOC));
Compare SQL Columns
Fatal Error:call to a member function Fetchall () on a non-object
Or is it a mistake to explode?
My SQL statement is fine. You can perform the display results in SQLite
It's the end of the PDO, isn't it? Does PDO not support indexed columns?
Sorry about the mistake. The output does not have a titles column.
But I do have this index column when I build my watch. And I'm sure it's okay to query in SQLite.
Why didn't you come here?
Just started with SQLite may have some misunderstanding?
SELECT * from Sqlite_master
Also not supported? Are you SQLite 2?
SELECT * from Sqlite_master
Also not supported? Are you SQLite 2?
Thank you for the moderator reason to find, originally troubled me two days of the problem is that my database address is wrong
I built two libraries. One less field I've been using this wrong database address for the last two days .....
haha too hard to force this time
Thank you very much for your enthusiastic reply.
I thanked you for being here.
$sth = $db->query ($sql);
$row = $sth->fetchall ();
Thank you very much for your enthusiasm. haha haha