Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter returning blank page on PostgreSQL error
#1

[eluser]Nameless One[/eluser]
I have this problem where CodeIgniter is returning a blank page whenever I have a bad query. Since I'm migrating from a MySQL database and CI doesn't behave very well with PostgreSQL, there will certainly be an error in almost every query.

My database.php is as follows:
Code:
$db['default']['hostname'] = "localhost";
$db['default']['dbdriver'] = "postgre";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";
$db['default']['swap_pre'] = "";
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

What should I do to get my sql errors reported by CI?
#2

[eluser]kea13[/eluser]
Hi Nameless One,

sorry, but i can't confirm the PostgreSQL not behaving well with CI part - working with no problems on my side ...
Considering your problem:
- did you check whether pg_hba.conf includes an authentication line suitable for your application?
- Did you check whether the PostgreSQL daemon is started?
- If so, is there a firewall between the application and the database that might block port 5432/tcp?

Happy hunting Smile

Regards,
Roman
#3

[eluser]Nameless One[/eluser]
I'm sorry if I didn't put enough emphasis on the nature of my problem. PostgreSQL and PHP work fine. When CI executes a good query, it works fine and I can see the results in the database. The problem is that it doesn't report an error when the query is bad. All I get is a blank page in most browsers. In Epiphany I get a "Connection terminated unexpectedly" error.

Due to this and the fact that CI doesn't support working with schema very well, especially when using libraries that implicitly use Database library, I've decided to go back to MySQL for the time being. All the great features of Postgre are nice but they don't count for much if I can't use them.
#4

[eluser]jmadsen[/eluser]
Are you certain this is a postgre problem? do you have error_reporting(E_ALL); in your main index.php file?

Even if you think you do, go back and check; sometimes you switch, and forget.
#5

[eluser]Nameless One[/eluser]
[quote author="jmadsen" date="1286898364"]Are you certain this is a postgre problem? do you have error_reporting(E_ALL); in your main index.php file?

Even if you think you do, go back and check; sometimes you switch, and forget.[/quote]

Yeah, my error reporting is E_ALL and error reporting is turned on in php.ini. My php errors are reported normally, such as when I omit a semicolon. The problem occurs only when I try to execute a bad query in PostgreSQL.




Theme © iAndrew 2016 - Forum software by © MyBB