darkfreaks Posted October 12, 2010 Share Posted October 12, 2010 how would i fix this? check your syntax near "LIMIT 0,10" $sql = "SELECT cam_systems.id, GROUP_CONCAT(system_disks.system_disks_qty) AS system_disks_qty, GROUP_CONCAT(DISTINCT system_disks.system_disks_make) AS system_disks_make, GROUP_CONCAT(DISTINCT system_disks.system_disks_model_no) AS system_disks_model_no, GROUP_CONCAT(DISTINCT system_disks.system_disks_size) AS system_disks_size, GROUP_CONCAT(DISTINCT system_memory.system_memory_qty) AS system_memory_qty, GROUP_CONCAT(DISTINCT system_memory.system_memory_serial_no) AS system_memory_serial_no, GROUP_CONCAT(DISTINCT system_memory.system_memory_manf) AS system_memory_manf, GROUP_CONCAT(DISTINCT system_memory.system_memory_part_no) AS system_memory_part_no, GROUP_CONCAT(DISTINCT system_memory.system_memory_size) AS system_memory_size, COUNT(*) FROM cam_systems, system_disks, system_memory WHERE cam_systems.location_id = '1' OR system_disks.system_id = 'cam_systems.id' AND system_memory.system_id = 'cam_systems.id' GROUP BY cam_systems.id DESC LIMIT 10"; Quote Link to comment https://forums.phpfreaks.com/topic/215737-query-help/ Share on other sites More sharing options...
Oziam Posted October 12, 2010 Share Posted October 12, 2010 put GROUP BY cam_systems.id DESC LIMIT 0,10"; Quote Link to comment https://forums.phpfreaks.com/topic/215737-query-help/#findComment-1121615 Share on other sites More sharing options...
darkfreaks Posted October 12, 2010 Author Share Posted October 12, 2010 still get the same error i'm using MYSQL 5.2 so there has to be outdated syntax somewhere Quote Link to comment https://forums.phpfreaks.com/topic/215737-query-help/#findComment-1121619 Share on other sites More sharing options...
Zane Posted October 13, 2010 Share Posted October 13, 2010 It's ORDER BY... LIMIT not GROUP BY Quote Link to comment https://forums.phpfreaks.com/topic/215737-query-help/#findComment-1121623 Share on other sites More sharing options...
darkfreaks Posted October 13, 2010 Author Share Posted October 13, 2010 has to be something much more than that. as i already tried order and group by makes no difference. Quote Link to comment https://forums.phpfreaks.com/topic/215737-query-help/#findComment-1121626 Share on other sites More sharing options...
darkfreaks Posted October 13, 2010 Author Share Posted October 13, 2010 i am pretty sure this is the problem line: ORDER BY cam_systems.id LIMIT 0,10 Quote Link to comment https://forums.phpfreaks.com/topic/215737-query-help/#findComment-1121627 Share on other sites More sharing options...
darkfreaks Posted October 13, 2010 Author Share Posted October 13, 2010 okay got it working Fix: GROUP_CONCAT(cam_systems.id ORDER BY cam_systems.id DESC), however now it outputs 5,5,5,4,4,3,3,3,3 when it should output something like 0,0 for the ID column oh group_cxoncat puts it all into one row not what i need lol Quote Link to comment https://forums.phpfreaks.com/topic/215737-query-help/#findComment-1121631 Share on other sites More sharing options...
darkfreaks Posted October 13, 2010 Author Share Posted October 13, 2010 okay so it wont work with LIMIT 0,10 but it does order by id Quote Link to comment https://forums.phpfreaks.com/topic/215737-query-help/#findComment-1121635 Share on other sites More sharing options...
darkfreaks Posted October 13, 2010 Author Share Posted October 13, 2010 fixed everything works now although ID is not showing up any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/215737-query-help/#findComment-1121642 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.