Welcome Guest, Not a member yet? Register   Sign In
Error handling when using database call_function()
#1

[eluser]tlloyduk[/eluser]
Hi All,

I hope you can help me Smile

I am using the Postgres driver and want to call pg_query and pg_fetch_all directly, so I found the call_function() function which does what I need perfectly.

My code:

Code:
$db_id = $this->db->conn_id;
$query = $this->db->call_function('query', $db_id, "SELECT * FROM " . $table);
$result = $this->db->call_function("fetch_all", $query);

My question:

How do I trap an error that is returned by pg_query or pg_fetch_all within the call_function() wrapper? For example if $table contains a reference to an invalid table, a PHP Warning message is displayed in the browser. I want to be able to trap that in advance and handle it myself.

Any ideas?

Thanks,

Tim


Messages In This Thread
Error handling when using database call_function() - by El Forum - 08-17-2012, 04:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB