ShCiPwA Posted February 25, 2010 Share Posted February 25, 2010 Hi Guys, I have a problem with running a mysql query using the mysqli api; I'm running PHP version 5.1.6 on linux with Apache 2. When I try execute a query on my server that works on my local machine the result set is false (failure) but mysqli_error($link) returns nothing at all. I expect it to come back with a result set or to provide me with an error why it failed. I have ensured I have an open and valid connection at the time of the query, I have also tried catching mysqli_sql_exception to no avail. No error seems to propegate, but the result of the query is false (failure according to the docs). Any help would be appreciated. My local machine is running php 5.2.9, and can successfully run the query through an ssh tunnel to the same database The wierd thing is that if I use the old mysql api the inverse happens, the query works on the server that is on lan with the database, and my local machine fails to connect through the ssh tunnel. The code that runs the query is as follows, and I make sure the connection is open before hand: try { $this->result = mysqli_query($this->dblink,$sql); }catch (mysqli_sql_exception $e) { print "Error Code <br>".$e->getCode(); print "Error Message <br>".$e->getMessage(); print "Strack Trace <br>".nl2br($e->getTraceAsString()); } if (!$this->result) { print("Error running query: ($sql) Error: (".mysqli_error($this->dblink).")"); } return $this->result; I suspect its somthing to do with the server configuration as the code works fine locally, any ideas would be appreciated. Cheers, ShCiPwA Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.