PDO::prepare cannot find an existing table.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

PDO::prepare cannot find an existing table.

Jared Smith
I just migrated to Zend Framework 0.6.0 from a lower version.

Code which was previously working is now generating this error:

Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'eca.part'
doesn't exist' in
/var/www/localhost/htdocs/echo/library/Zend/Db/Adapter/Pdo/Abstract.php:119

The table DOES exist, and I can query it fine from mysql command line.

It looks like a PDO::prepare error, for that is what is happening on
line 119, simply a call to _connection->prepare($sql).

The SQL statement is a vanilla SELECT with no joins, from a single
table. This error comes up with every SELECT query I run on any table.
Does anyone recognize this problem?

-Jared
Reply | Threaded
Open this post in threaded view
|

Re: PDO::prepare cannot find an existing table.

waigani-2
I've got same problem.Using ZF 1.03, trying to connect to mysql table:

Zend_Db_Statement_Exception' with message 'SQLSTATE[42S02]: Base table or view not found: 1146


Jared Smith wrote
I just migrated to Zend Framework 0.6.0 from a lower version.

Code which was previously working is now generating this error:

Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'eca.part'
doesn't exist' in
/var/www/localhost/htdocs/echo/library/Zend/Db/Adapter/Pdo/Abstract.php:119

The table DOES exist, and I can query it fine from mysql command line.

It looks like a PDO::prepare error, for that is what is happening on
line 119, simply a call to _connection->prepare($sql).

The SQL statement is a vanilla SELECT with no joins, from a single
table. This error comes up with every SELECT query I run on any table.
Does anyone recognize this problem?

-Jared
Reply | Threaded
Open this post in threaded view
|

Re: PDO::prepare cannot find an existing table.

mike patel
Hi,
 the table name is case-sensitive now. for e.g. the table name in mysql db was "USERS", while I tried it as "users". I got the same error as yours.


Waigani wrote
I've got same problem.Using ZF 1.03, trying to connect to mysql table:

Zend_Db_Statement_Exception' with message 'SQLSTATE[42S02]: Base table or view not found: 1146


Jared Smith wrote
I just migrated to Zend Framework 0.6.0 from a lower version.

Code which was previously working is now generating this error:

Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'eca.part'
doesn't exist' in
/var/www/localhost/htdocs/echo/library/Zend/Db/Adapter/Pdo/Abstract.php:119

The table DOES exist, and I can query it fine from mysql command line.

It looks like a PDO::prepare error, for that is what is happening on
line 119, simply a call to _connection->prepare($sql).

The SQL statement is a vanilla SELECT with no joins, from a single
table. This error comes up with every SELECT query I run on any table.
Does anyone recognize this problem?

-Jared