Advertisement
miholeus

Zend_Db_Mysqli strange

Jan 29th, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. <?php
  2. // Ensure library/ is on include_path
  3. set_include_path(implode(PATH_SEPARATOR, array(
  4.     realpath('./library'),
  5.     get_include_path(),
  6. )));
  7.  
  8. /** Zend_Application */
  9. require_once 'Zend/Loader.php';
  10. Zend_Loader::loadClass('Zend_Config_Ini');
  11. Zend_Loader::loadClass('Zend_Db');
  12.  
  13. $params = array(
  14.     'adapter' => 'mysqli',
  15.     'params' => array(
  16.         'host'      => 'localhost',
  17.         'dbname'    => 'test',
  18.         'username'  => 'root',
  19.         'password'  => ''
  20.     )
  21. );
  22.  
  23. $db = \Zend_Db::factory($params['adapter'], $params['params']);
  24.  
  25. $curtimeStmt = $db->query("SELECT CURTIME()");
  26.  
  27. $nowStmt = $db->query("SELECT NOW()");
  28.  
  29. $s = $curtimeStmt->fetch();
  30. var_dump($s);// false. Where is curtime?!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement