php - Codeigniter HTML list helper breaks the DB class -


model method

public function my_friends_list($myid) {     $query = $this->db->query("call myfriendslist($myid)");     return $query->result_array(); } 

controller

public function index() {     $data['friends'] = $this->friends_model->my_friends_list(1);     $this->load->view('friends/index', $data); } 

view

<?php     $list = $friends;     echo(ul($list)); ?> 

if use above works. if change view this:

<?php     //$list = $friends;     echo(ul($friends)); ?> 

i following error message

unable select specified database: my_database_name

filename: c:\xampp\htdocs\system\database\db_driver.php

i know use view works want understand what's going on. not equivalent??

edit: after go original view, way clear error restart mysql module.

you calling stored procedure go "config/database.php" , change below code.

$db['default']['dbdriver'] = 'mysql';  $db['default']['dbdriver'] = 'mysqli'; , pconnect should true $db['default']['pconnect'] = true; 

hope help.


Comments