Worst use of query
for(int i=0; i<query("SELECT COUNT ...."); i++)
This query iterates n times til the loop ends. And result of the query doesn't change.
count = query("SELECT COUNT ....");
for(int i=0; i<count; i++)
DELETE FROM table;
This query contain no where clause.
Before execute the query delete or update just select and check the right row is affecting.
SELECT * FROM sometable
WHERE field LIKE '%something'
OR LIKE 'something%'
OR LIKE '%something%';
This query contains 3 like condition. Third condition selects first and second condition selects.
select * from users where clue > 0;
0 results found.
It never returns any results, no matter where and why you run it.
select * from *
Really very bad.