Hi!
i wrote an easy script in CI for testing db access...
using mysql driver it works, but it shows a warning message
Code:
A PHP Error was encountered
Severity: 8192
Message: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead
Filename: mysql/mysql_driver.php
Line Number: 135
Backtrace:
File: /web/htdocs/www.plickapp.com/home/API/index.php
Line: 315
Function: require_once
i've tried to use it with mysqli or pdo but without results...
Somebody can help me?
Controller - View_events.php
PHP Code:
<?php if ( ! defined('BASEPATH'))exit('No direct script access allowed');
class View_events extends CI_Controller
{
public function amichevolmente($a =false)
{
$data = array();
$data['saluta_a'] = $a;
//$this->load->view('stampa_eventi',$data);
echo "prova";
}
public function stampa_eventi()
{
//$this->load->database();
$this->load->model('Eventi_model');
$data=$this->Eventi_model->getEventi();
echo $data;
}
}
Model - Eventi_model.php
PHP Code:
<?php
class Eventi_model extends CI_Model {
function __construct()
{
parent::__construct();
}
function getEventi()
{
$query=$this->db->get('events');
if($query->num_rows < 1)
return "NO";
else
return "SI";
//echo "eventi";
}
}
and the mysql config
Code:
$db['default'] = array(
'dsn' => '',
'hostname' => 'DB_ADDRESS',
'username' => 'DB_USERNAME',
'password' => '*********',
'database' => 'Sql1138857_1',
'dbdriver' => 'mysql',
'dbprefix' => '',
'pconnect' => TRUE,
'db_debug' => TRUE, //(ENVIRONMENT !== 'production')
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
i've already tried to change "mysql" in "mysqli" in dbdriver.. and it doesn't work.
using pdo config (dsn) i have the samre result.