![]() |
MySQL not working - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: MySQL not working (/showthread.php?tid=34497) Pages:
1
2
|
MySQL not working - El Forum - 10-01-2010 [eluser]klompie[/eluser] Have searched for this en found others with the same sort of problems, but cant solve this. when i use $autoload['libraries'] = array('database'); nothing will load. every page i open stays white. (no source too) this is my loaded controller: Code: <?php when i disable autoloading of database it echo's "Hello World! Connected!" so this way it is working. I tried setting pconnect to false but this did not solve it. So how to solve this. ![]() MySQL not working - El Forum - 10-01-2010 [eluser]jmadsen[/eluser] That "white page" probably has an error message written in magic ink; go to: htdocs/index.php and set "error_reporting(E_ALL);" It should give you a message to help get you started, or at least to report to us so we can explain it. MySQL not working - El Forum - 10-01-2010 [eluser]klompie[/eluser] Error reporting is set to E_ALL. (By default CI runs with error reporting set to ALL) MySQL not working - El Forum - 10-01-2010 [eluser]jmadsen[/eluser] have you tried using the CI db class instead of php's functions? Does that work? also, is your config/database.php file set up correctly? I'm not really sure what the issue would be, but most people have no trouble, so probably just a config, etc. not set up correctly MySQL not working - El Forum - 10-01-2010 [eluser]klompie[/eluser] How do you mean? Using php functions it is working. using $autoload[‘libraries’] = array(‘database’); it is not working MySQL not working - El Forum - 10-01-2010 [eluser]jmadsen[/eluser] instead of Code: mysql_connect("localhost","crm_user","******") or die(mysql_error()); use: Code: $this->db->query('YOUR QUERY HERE'); MySQL not working - El Forum - 10-01-2010 [eluser]klompie[/eluser] With autoload enabled it gives me a white screen. With autolood disable is gives me Message: Undefined property: Klant::$db (as expected) MySQL not working - El Forum - 10-01-2010 [eluser]jmadsen[/eluser] is this with the method I suggested? ($this->db->query('YOUR QUERY HERE'); ) also, what does your database.php file look like? Please give us ALL the information you can. MySQL not working - El Forum - 10-01-2010 [eluser]klompie[/eluser] This is my database.php: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); this is my controller: Code: <?php this is my autoload: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); And this gives me... nothing (a white screen) MySQL not working - El Forum - 10-01-2010 [eluser]techgnome[/eluser] Are you sure mySQL is up and running? There has been more than once when I've forgotten to hit the Start button to spin up mySQL. -tg |