mardi 5 juillet 2016

Mysql commands out of sync

I get Commands out of sync; you can't run this command now when running this query, but I can't find anything wrong with it

SELECT *
FROM (SELECT
        (SELECT `name`
         FROM `users` `u`
         WHERE `c`.`user_id` = `u`.`id`) AS `rep_name`,
        `c`.`id`,
        `c`.`group_title`,
        `c`.`area`,
        `c`.`city`,
        `c`.`address`,
        `t`.`tag`
      FROM `tags` `t`
        INNER JOIN `companies` `c` ON ((SELECT `company_id`
                                        FROM `company_tag`
                                        WHERE `t`.`id` = `tag_id`) = `c`.`id`)) `t`
WHERE `t`.`rep_name` LIKE '%test%'
      OR `t`.`group_title` LIKE '%test%'
      OR `t`.`area` LIKE '%test%'
      OR `t`.`city` LIKE '%test%'
      OR `t`.`address` LIKE '%test%'
      OR `t`.`tag` LIKE '%test%'
LIMIT 10

the weird thing is that is some cases, it works, depending on the search input,

Aucun commentaire:

Enregistrer un commentaire