Jump to content

query help


darkfreaks

Recommended Posts

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"; 

Link to comment
https://forums.phpfreaks.com/topic/215737-query-help/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/215737-query-help/#findComment-1121631
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.