Filtro n
Filtro n
jorgemjunior
Posts: 3Questions: 0Answers: 0
Primeiramente parab
This discussion has been closed.
Replies
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
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
/ / 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 '] )."%'";
)
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