Filter data with sql query and join tables

Filter data with sql query and join tables

sandb0xsandb0x Posts: 5Questions: 0Answers: 0
edited August 2012 in General
I haven't been using DT very long, and am wanting to join 2 tables and also apply a filter if a record value is not equal to 1. I tried adding my sql that works, but it breaks the search box function. I guess I am wanting to know where to put my WHERE filter to not break the one in the example file for server-side processing.

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    Since you are using server-side processing, just locate the part in the script which builds the WHERE condition and modify it to add your condition. What modification have you tried that doesn't work?

    Allan
  • sandb0xsandb0x Posts: 5Questions: 0Answers: 0
    Well after posting that I figured out the WHERE part of my SQL statement, but can't get the join to work. I added the WHERE to the existing filtering check which seemed to work. I tried a couple of posted JOIN statements to no avail.
  • sandb0xsandb0x Posts: 5Questions: 0Answers: 0
    edited August 2012
    I have narrowed my JOIN problem down to this part of the $sQuery statement:
    [code]`".str_replace(" , ", " ", implode("`, `", $aColumns))."` [/code]

    If I take this out and put an * in it's place my JOIN works, but my search box gets broken.
  • sandb0xsandb0x Posts: 5Questions: 0Answers: 0
    edited September 2012
    I think the JOIN statement might not be working due to my database possibly, but i'm not 100% sure
This discussion has been closed.