Click here to Skip to main content
15,887,350 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created one registration page and try to insert into database

code :
PHP
public function processAction()
{
   
  $params = array('host'      =>'localhost',

                  'username'  =>'root',

                  'password'  =>'root',

                  'dbname'    =>'db'

                 );
 

  $DB = new Zend_Db_Adapter_Pdo_Mysql($params);



  $request = $this->getRequest();

 
  $sql = "INSERT INTO `aaa`

          (`name` , `password` ,`city` ,`ph`)

          VALUES

          ('".$request->getParam('first_name')."', '".$request->getParam('last_name')."', '".$request->getParam('user_name')."', MD5('".$request->getParam('password')."'))";
echo $sql;
  $DB->query($sql);



  $this->view->assign('title','Registration Process');

  $this->view->assign('description','Registration succes');



}
Posted

1 solution

According to your code snippet you missing the 'include' part...
You should have some require/require_once statement at the top of your code...
PHP
require_once '../Zend/Db/Adapter/Pdo/Mysql.php';

The exact path depends on your installation of course...
You may read more about it here: http://framework.zend.com/manual/1.10/en/zend.db.adapter.html[^]
 
Share this answer
 
Comments
neethujayan 21-Sep-14 4:30am    
i have included that that in index.php file ..
then i got error like this

"Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in C:\wamp\www\HelloZend\library\Zend\Controller\Plugin\Broker.php on line 336"
Kornfeld Eliyahu Peter 21-Sep-14 4:36am    
1. do the include also in this file, including it in index.php only will not help you
2. Please check your Zend installation - it seems to be broken...
neethujayan 21-Sep-14 5:01am    
i have included it in both index.php and Controller page.
Error:

"Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in C:\wamp\www\HelloZend\library\Zend\Controller\Plugin\Broker.php on line 336"

and

Zend_Controller_Exception: Invalid controller specified (error)#0 C:\wamp\www\HelloZend\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 C:\wamp\www\HelloZend\library\Zend\Controller\Front.php(212): Zend_Controller_Front->dispatch() #2 C:\wamp\www\HelloZend\index.php(26): Zend_Controller_Front::run('application/con...') #3 {main} in C:\wamp\www\HelloZend\library\Zend\Controller\Plugin\Broker.php on line 336

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900