Tuesday, 13 August 2013

Having problems accessing tables with mysqli

Having problems accessing tables with mysqli

I'm having a strange problem with the php mysqli extension. On my local
LAMP installation everything works fine.
After testing my site in the final production environment, I'm getting
strange errors.
This is an excerpt out of my site internal SQL logfile:
[SUCCESS] SELECT * FROM `tbl1` ORDER BY `created` DESC LIMIT 20;
[ERROR] SELECT * FROM `tbl1` ORDER BY `created` DESC LIMIT 20;
(Table 'dbname.tbl1' doesn't exist)
[SUCCESS] SELECT * FROM `tbl1` ORDER BY `created` DESC LIMIT 20;
[SUCCESS] SELECT * FROM `tbl1` ORDER BY `created` DESC LIMIT 20;
For testing purposes, I executed the same query four times in one
function. Three out of four times the query succeeded. The failed query
returns an error: Table 'dbname.tbl1' doesn't exist.
This problem appears always with different tables and in different
functions. Sometimes tbl1 is missing, after hitting F5 tbl2 seems to be
missing...
There seems to be a problem with my server settings since the queries
always work in my local dev environment but only sometimes in the
production environment.
Does anyone know what could cause this problem?

No comments:

Post a Comment