[Solar-talk] Fatal error: Uncaught exception 'Solar_Controller_Page_Exception_DuringFetch' error

Walker, Jason T. Jason.Walker at gd-ais.com
Tue Nov 13 12:17:25 CST 2007


We're currently trying to implement a Solar Model to connect to our
MySQL database.  We've set up our model with the following:


<?php
class MYSQLDB_Models_Asset extends Solar_Sql_Model{
	
	   /**
     * 
     * Schema setup.
     * 
     * @return void
     * 
     */
    protected function _setup()
    {
        // the table name
        $this->_name = 'ASSET';        
    }
	
}




When we try to load up the page we're gettin the following error
displayed in the browser:
Fatal error: Uncaught exception
'Solar_Controller_Page_Exception_DuringFetch' class::code
'MYSQLDB_App_PatrolAvailability::ERR_DURING_FETCH' with message
'Exception encountered in the fetch() method.' information array (
'exception' =>
Solar_Sql_Adapter_Exception_QueryFailed::__set_state(array( '_info' =>
array ( 'pdo_code' => '42000', 'pdo_text' => 'SQLSTATE[42000]: Syntax
error or access violation: 1064 You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the
right syntax to use near \') TYPE=InnoDB\' at line 3', 'host' =>
'192.48.143.51', 'port' => 3306, 'user' => 'usrname', 'name' =>
'MYSQLDB', 'stmt' => 'CREATE TABLE areas ( ) TYPE=InnoDB', 'pdo_trace'
=> '#0 C:\\Solar\\Solar-0.28.0\\Solar\\Sql\\Adapter.php(541):
PDOStatement->execute() #1
C:\\Solar\\Solar-0.28.0\\Solar\\Sql\\Adapter.php(1466):
Solar_Sql_Adapter->query(\'CREATE TABLE ar...\') #2
C:\\Solar\\Solar-0.28.0\\Solar\\Sql\\Model.php(2283): S in
C:\Solar\Solar-0.28.0\Solar.php on line 573

We checked the apache accesslog file and found the error below:

PHP Fatal error:  Uncaught exception
'Solar_Controller_Page_Exception_DuringFetch'
class::code 'MYSQLDB_App_PatrolAvailability::ERR_DURING_FETCH' 
with message 'Exception encountered in the fetch() method.' 
information array (
  'exception' => 
  Solar_Sql_Adapter_Exception_QueryFailed::__set_state(array(
     '_info' => 
    array (
      'pdo_code' => '42000',
      'pdo_text' => 'SQLSTATE[42000]: Syntax error or access violation:
1064 You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near \') TYPE=InnoDB\' at line 3',
      'host' => '192.48.143.51',
      'port' => 3306,
      'user' => 'usrname',
      'name' => 'MYSQLDB',
      'stmt' => 'CREATE TABLE areas (
	
) TYPE=InnoDB',
      'pdo_trace' => '#0
C:\\Solar\\Solar-0.28.0\\Solar\\Sql\\Adapter.php(541):
PDOStatement->execute()
#1 C:\\Solar\\Solar-0.28.0\\Solar\\Sql\\Adapter.php(1466):
Solar_Sql_Adapter->query(\'CREATE TABLE ar...\')
#2 C:\\Solar\\Solar-0.28.0\\Solar\\Sql\\Model.php(2283): S in
C:\Solar\Solar-0.28.0\Solar.php on line 573
127.0.0.1 - - [13/Nov/2007:13:08:45 -0500] "GET
/SolarApps/PatrolAvailability HTTP/1.1" 200 1156

Is there a reason why Solar is trying to create a new table in our
database when the table already exists?
      'stmt' => 'CREATE TABLE areas (

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman-mail3.webfaction.com/pipermail/solar-talk/attachments/20071113/29693d38/attachment.html


More information about the Solar-talk mailing list