If anidados
Publicado por Enrrique Guzman (1 intervención) el 19/11/2008 21:07:21
Hola a todos de antemano muchas gracias
tengon un inconveniente con el siguiente filtro haciendo if anidados y el codigo es este
$_pagi_sql="select r.ID,r.Nombres,r.Fecha,r.Hora_Ini,Contacto,r.Operador,r.Telefono,r.ippublica
from reportes r
where r.ID=r.ID Order By r.Operador,r.Fecha,Nombres ASC";
//cantidad de resultados por página (opcional, por defecto 20)
$_pagi_cuantos = 20;
include("paginator.inc.php");
//Filtros
if (isset($_POST['operador']))
if (isset($_POST['CAPACITADOR']))
if (isset($_POST['fecha_inicio']))
{
$_pagi_sql=$_pagi_sql." and r.Operador ='".$_POST["operador"]."' and r.Nombres ='".$_POST["CAPACITADOR"]."' and r.Fecha ='".$_POST["fecha_inicio"]."'";
}
//fin de Filtros
if ($Base->consulta($_pagi_sql))
{
?>
me arroja el siguiente error
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND r.Operador = 'BT' AND r.Nombres = 'Angélica Patricia Celedon´
ayundenme
tengon un inconveniente con el siguiente filtro haciendo if anidados y el codigo es este
$_pagi_sql="select r.ID,r.Nombres,r.Fecha,r.Hora_Ini,Contacto,r.Operador,r.Telefono,r.ippublica
from reportes r
where r.ID=r.ID Order By r.Operador,r.Fecha,Nombres ASC";
//cantidad de resultados por página (opcional, por defecto 20)
$_pagi_cuantos = 20;
include("paginator.inc.php");
//Filtros
if (isset($_POST['operador']))
if (isset($_POST['CAPACITADOR']))
if (isset($_POST['fecha_inicio']))
{
$_pagi_sql=$_pagi_sql." and r.Operador ='".$_POST["operador"]."' and r.Nombres ='".$_POST["CAPACITADOR"]."' and r.Fecha ='".$_POST["fecha_inicio"]."'";
}
//fin de Filtros
if ($Base->consulta($_pagi_sql))
{
?>
me arroja el siguiente error
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND r.Operador = 'BT' AND r.Nombres = 'Angélica Patricia Celedon´
ayundenme
Valora esta pregunta


0