Ver Mensaje Individual
  #3 (permalink)  
Antiguo 24/03/2010, 16:04
antony1204
 
Fecha de Ingreso: marzo-2010
Mensajes: 14
Antigüedad: 14 años, 1 mes
Puntos: 0
Respuesta: problema con opcion buscar php sql

hola lo hago de esta forma :
//*********FILTRO*******************

if ($_REQUEST["btnbuscar"]!="" && $_REQUEST["cbuscar"]!="")

{
if (is_numeric( $_REQUEST["cbuscar"])) // (1)
$filtro=$_REQUEST["cbuscar"];

o asi:

$filtro="id_cuenta".$_REQUEST["cbuscar"];// (2)


}
else
{
$mensaje= "<font color='Red'> Por Favor Escriba Algo En El cuadro De Texto Para Realizar La Busqueda</font>";
}

y la consulta asi :

$query_Profesores = "SELECT * FROM cuenta where id_cuenta =$filtro" ;// (1)

o asi

$query_Profesores = "SELECT * FROM cuenta where $filtro" ;// (2)


(1) y (1) y (2) y (2) ahora me sale esto:

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 '' at line 1

probando las dos formas

Ayuda por favor........