output=error&msg=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
Código PHP:
<?php
/**/
include("includes/config.php");
include("includes/funciones.php");
/**/
$cnx = conectar();
/**/
$sql = " SELECT * FROM directorio WHERE id=".$_POST['id'];
/**/
$res = mysql_query($sql) or die("output=error&msg=".mysql_error());
/**/
if(mysql_num_rows($res) >0){
/**/
$salida = "&output=ok&";
/**/
while($fila = mysql_fetch_array($res)){
$salida .="id=".$fila['id'];
$salida .="&nombre=".utf8_encode($fila['nombre']);
$salida .="&apellido=".utf8_encode($fila['apellido']);
$salida .="&nick=".utf8_encode($fila['nick']);
$salida .="&url=".$fila['url'];
$salida .="&email=".$fila['email']."&";
}
/**/
echo $salida;
/**/
mysql_free_result($res);
/**/
mysql_close($cnx);
} else {
/**/
echo "output=error&msg=No se encontraron resultados";
}
?>