SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2006
    0 Post(s)
    0 Thread(s)

    Zend Framework fetchRow problem

    I'm totally confused by a database bug with the Zend Framework. The issue is that in the code below "$row = $resources->fetchRow($where);" is taking 4 or 5 seconds to execute. It still works, the data is fetched from the database. When I use a simple db query from the example in it executes instantly. I have tried different versions of the Zend Framework which makes no difference, on top of that I have another site on the same server that uses nearly identical code with no problem at all.

    I am completely baffled by it. What would make it the fetchRow take so long but not make it fail or throw any errors? Any suggestions would be greatly appreciated.

    // Bootstrap
    $db = Zend_Db::factory($config->database->type, $config->database->toArray());
    $registry->set('db', $db);
    // Resources()
    class Resources extends Zend_Db_Table_Abstract
        protected $_name = 'resources';    
    // The query
    $resourcePage = 1;       
    require_once 'Resources.php';
    $resources = new Resources();
    $where = $resources->getAdapter()->quoteInto('link_number = ?', $resourcePage);	        
    $row = $resources->fetchRow($where);
    Many thanks,

  2. #2
    Team SitePoint santouras's Avatar
    Join Date
    Jul 2006
    planet earth
    16 Post(s)
    0 Thread(s)
    I would try using the database profiler to see whats going on with your query, see if that can point anything out. Also, it might not be reporting an error depending on how your script is setup, is it throwing any exceptions? Failing that I would try posting onto the ZF mailing list, those guys all know what they're talking about and you'll be asking a lot of people who actually write the code for the framework
    my utility belt tells me its to the bar batman

    read the manual then google it then do a search THEN post....


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts