Filtro n

Filtro n

jorgemjuniorjorgemjunior Posts: 3Questions: 0Answers: 0
edited August 2009 in General
Primeiramente parab

Replies

  • allanallan Posts: 54,909Questions: 1Answers: 8,606 Site admin
    Hi,

    Sorry - my answer is going to be in English...! Your 'where' statement looks a little odd. Try using something like this:

    [code]
    $sWhere = "";
    if ( $_GET['sSearch'] != "" )
    {
    $sWhere = "WHERE engine LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ".
    "browser LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ".
    "platform LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ".
    "version LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ".
    "grade LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%'";
    }
    [/code]

    If that doesn't work - could you post your full PHP code and a link to the DataTables page?

    Regards,
    Allan
  • jorgemjuniorjorgemjunior Posts: 3Questions: 0Answers: 0
    Thanks for fast response
    but my problem is when I use the "WHERE" try to make a filter in various tables such as "WHERE tb_marca.id_marca = tb_tipo.id_tipo" this point the search filters and order to operate
  • jorgemjuniorjorgemjunior Posts: 3Questions: 0Answers: 0
    $ sWhere = "Where tb_marca.id_marca = tb_tipo.id_tipo";
    / / This variable I'm doing a query of a database

    / / This code I've not only adapted
    if ($ _GET [ 'ssearch']! = "")
    (

    $ sWhere = "WHERE engine LIKE '%". mysql_real_escape_string ($ _GET [' ssearch '] )."%' OR ".
    browser LIKE '% ". mysql_real_escape_string ($ _GET [' ssearch '] )."%' OR".
    "platform LIKE '%". mysql_real_escape_string ($ _GET [' ssearch '] )."%' OR ".
    "version LIKE '%". mysql_real_escape_string ($ _GET [' ssearch '] )."%' OR ".
    "grid LIKE '%". mysql_real_escape_string ($ _GET [' ssearch '] )."%'";
    )
  • allanallan Posts: 54,909Questions: 1Answers: 8,606 Site admin
    Hi,

    I think this is probably more of a MySQL question, so you might be best asking it on a SQL forum... However, at a rough guess, you have the first join condition with "WHERE tb_marca.id_marca = tb_tipo.id_tipo", are you then correctly specifying the other columns that need to be filtered on. For example "WHERE tb_marca.id_marca = tb_tipo.id_tipo AND ( tb_tipo.whatever LIKE 'search' OR tb_tipo.whatever2 LIKE 'search2' etc )"?

    Regards,
    Allan
This discussion has been closed.