Foros del Web » Programando para Internet » PHP » Zend »

Ayuda con conexion en zend framework

Estas en el tema de Ayuda con conexion en zend framework en el foro de Zend en Foros del Web. hola amigos como hago la conexion en zend frameworkm xq no muestra nada por la pantalla hice asi: aplication/views/script/index/index.phtml : Código PHP: <?php       $options  = array( ...
  #1 (permalink)  
Antiguo 19/03/2010, 12:35
 
Fecha de Ingreso: marzo-2009
Mensajes: 356
Antigüedad: 15 años, 1 mes
Puntos: 7
Ayuda con conexion en zend framework

hola amigos como hago la conexion en zend frameworkm xq no muestra nada por la pantalla

hice asi:
aplication/views/script/index/index.phtml :
Código PHP:
<?php
      $options 
= array(
          
Zend_Db::ALLOW_SERIALIZATION => false
      
);

      
$params = array(
          
'host'           => 'localhost',
          
'username'       => 'root',
          
'password'       => '123456',
          
'dbname'         => 'test',
          
'options'        => $options
      
);
$db Zend_Db::factory('Pdo_Mysql'$params);

$db->setFetchMode(Zend_Db::FETCH_OBJ);
$result $db->fetchAll('SELECT * FROM bugs WHERE bug_id = 1'2);
// $result is an array of objects
echo $result[0]->bug_description;
y en public / index.php

Código PHP:
<?php

// Define path to application directory
defined('APPLICATION_PATH')
    || 
define('APPLICATION_PATH'realpath(dirname(__FILE__) . '/../application'));

// Define application environment
defined('APPLICATION_ENV')
    || 
define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    
realpath(APPLICATION_PATH '/../library'),
    
get_include_path(),
)));

/** Zend_Application */
require_once 'Zend/Application.php';

// Create application, bootstrap, and run
$application = new Zend_Application(
    
APPLICATION_ENV,
    
APPLICATION_PATH '/configs/application.ini'
);
$application->bootstrap()
            ->
run();


$options = array(
  
Zend_Db::ALLOW_SERIALIZATION => false
);
  #2 (permalink)  
Antiguo 19/03/2010, 12:42
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 10 meses
Puntos: 2135
Tema movido desde PHP a PHP orientado a objetos

Etiquetas: conexion, framework
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:32.