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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.