I have a problem in the trend of SQL
in PHP
$where = '';
$sTable = "clientes";
$type = 'client(1);';
$usid = $_COOKIE['c_user'];
$where = "";;
if($_GET['q']!= "" ){
$where.= " WHERE fullname like '%$q%' AND user_id=1 ";
}
$where.="order by fullname desc";
$query_Dataclient = ("SELECT * FROM $sTable $where LIMIT $offset,$maximo_pagina");
$Dataclient = mysql_query($query_Dataclient, $conexion) or die(mysql_error());
$row_Dataclient = mysql_fetch_assoc($Dataclient);
$totalRows_Dataclient = mysql_num_rows($Dataclient);
Error that comes out:
In which says if($_GET['q'])!='')
that if it works well the other nose does not work with AND
ni WHERE
error message
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND user_id = 1 LIMIT 0.7' at line 1