Commands out of sync; you can't run this command now
5
votes
3
answers
64306
views
I have a query which was working fine a few days back:
SELECT
id, title, details, filetype, filepath, size, details, location, datetime,
IF(hid=1, 'Anonymous',
(
SELECT name
FROM users
WHERE did = userid
))
AS username
FROM infotable
WHERE ext2!='0'
ORDER BY id DESC
LIMIT 50
but a couple of days back, it started giving an error:
> Commands out of sync; you can't run this command now
I am calling it from a PHP page but I have also tried it from MySQL's GUI to run it as SQL query. It gave the the same error:
When I googled, I found that it may be due to MySQL to MySQLi update. I tried a lot to write an alternate query using MySQLi, but every time I got an error (Some times the same error and some times other errors).
My questions are:
**1. What this can be called as: *Sub Query* or *Multi Query***
**2. What is the exact error and what is its solution?**

Asked by SJSSoft
(151 rep)
Feb 22, 2016, 07:05 AM
Last activity: Feb 19, 2021, 08:47 PM
Last activity: Feb 19, 2021, 08:47 PM