Database problems. mysql/mysqli/pdo - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9) +--- Thread: Database problems. mysql/mysqli/pdo (/showthread.php?tid=69076) |
Database problems. mysql/mysqli/pdo - Valerekk - 10-04-2017 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 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'); Model - Eventi_model.php PHP Code: <?php and the mysql config Code: $db['default'] = array( 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. RE: Database problems. mysql/mysqli/pdo - Narf - 10-04-2017 Define what you mean by "doesn't work". RE: Database problems. mysql/mysqli/pdo - Valerekk - 10-04-2017 (10-04-2017, 07:42 AM)Narf Wrote: Define what you mean by "doesn't work". I'm sorry. how you can see in model Code: if($query->num_rows < 1) with mysqli and PDO is "NO". the table is so easy and i've tried also to use $query=$this->db->query('MY_QUERY'); instead of $query=$this->db->get('events'); RE: Database problems. mysql/mysqli/pdo - Narf - 10-04-2017 You should be using num_rows() - the method, not a property. RE: Database problems. mysql/mysqli/pdo - Valerekk - 10-04-2017 (10-04-2017, 10:15 AM)Narf Wrote: You should be using num_rows() - the method, not a property. omg... i'm feeling so stupid... It works... thanks |