[11-May-2016 17:04:00 Europe/Berlin] Database Line 134: 262144
[11-May-2016 17:04:00 Europe/Berlin] MySQLi link IS Valid?:
[11-May-2016 17:04:00 Europe/Berlin] 1
[11-May-2016 17:04:00 Europe/Berlin] mysqli
[11-May-2016 17:04:00 Europe/Berlin] Database Line 139: 262144
[11-May-2016 17:04:00 Europe/Berlin] Performing Query: 'SELECT * FROM
scans
INNER JOIN landlot
on scans.scansId = landlot.scansId
INNER JOIN district
on scans.scansid = district.scansId
INNER JOIN streetname
on scans.scansid = streetname.scansId WHERE Lot = 1;'
[11-May-2016 17:04:00 Europe/Berlin] PHP Warning: mysqli_query():
Couldn't fetch mysqli in
I:xampphtdocsGLS_DBSearchProjectDatabase.php on line 145
[11-May-2016 17:04:00 Europe/Berlin] Result: NULL
[11-May-2016 17:04:00 Europe/Berlin] Database Line 141: 262144
[11-May-2016 17:04:00 Europe/Berlin] Database Line 147: 262144
[11-May-2016 17:04:00 Europe/Berlin] PHP Notice: Trying to get
property of non-object in
I:xampphtdocsGLS_DBSearchProjectDatabaseSearch.php on line 86
[11-May-2016 17:04:00 Europe/Berlin] Database Line 134: 262144
[11-May-2016 17:04:00 Europe/Berlin] MySQLi link IS Valid?:
[11-May-2016 17:04:00 Europe/Berlin] 1
[11-May-2016 17:04:00 Europe/Berlin] mysqli
[11-May-2016 17:04:00 Europe/Berlin] Database Line 139: 262144
[11-May-2016 17:04:00 Europe/Berlin] Performing Query: 'SELECT * FROM
scans
INNER JOIN landlot
on scans.scansId = landlot.scansId
INNER JOIN district
on scans.scansid = district.scansId
INNER JOIN streetname
on scans.scansid = streetname.scansId WHERE Lot = 1 LIMIT 10 OFFSET 0;'
[11-May-2016 17:04:00 Europe/Berlin] PHP Warning: mysqli_query():
Couldn't fetch mysqli in
I:xampphtdocsGLS_DBSearchProjectDatabase.php on line 145
[11-May-2016 17:04:00 Europe/Berlin] Result: NULL
[11-May-2016 17:04:00 Europe/Berlin] Database Line 141: 262144
[11-May-2016 17:04:00 Europe/Berlin] Database Line 147: 262144
[11-May-2016 17:04:00 Europe/Berlin] PHP Fatal error: Call to a
member function fetch_assoc() on a non-object in
I:xampphtdocsGLS_DBSearchProjectDatabaseSearch.php on line 126
I'm really confused as to why mysqli_query is failing to return a result. I have used my QueryDatabase() function numerous times throughout my project and have encountered no issues until now. I have a PHPUnit test which shows that my QueryDatabase() function appears to be working properly, and all other signs point to the problem occurring during the mysqli_query() function call.
I have extensively checked to make sure that the database link (the mysqli object contained within $this->link) is valid and points to the appropriate database. I have also checked to ensure that my query works as expected by manually copying and pasting it into the mysql query browser.
If my query is valid AND my database link is valid why could mysqli_query() be failing?
Edit: I never closed any of my database connections. So the database connection should not be closed