Me muestra la página ok, pero en la parte superior de la pantalla me aparece:
SELECT ciudad, tituloanuncio, descripcionanuncio FROM contactos WHERE ciudad LIKE CONCAT('%', TRIM(IF(LENGTH(TRIM('')) > 0, '', ciudad)), '%') AND tituloanuncio LIKE CONCAT('%', TRIM(IF(LENGTH(TRIM('')) > 0, '', tituloanuncio)), '%') AND descripcionanuncio LIKE CONCAT('%', TRIM(IF(LENGTH(TRIM('')) > 0, '', descripcionanuncio)), '%')
con el código:
Código PHP:
Ver original<?php require_once('Connections/contactos.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
}
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ?
intval($theValue) : "NULL"; break;
case "double":
$theValue = ($theValue != "") ?
doubleval($theValue) : "NULL"; break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$query_Recordset1 = "SELECT ciudad, tituloanuncio, descripcionanuncio FROM contactos WHERE ciudad LIKE CONCAT('%', TRIM(IF(LENGTH(TRIM('$ciud')) > 0, '$ciud', ciudad)), '%') AND tituloanuncio LIKE CONCAT('%', TRIM(IF(LENGTH(TRIM('$titul')) > 0, '$titul', tituloanuncio)), '%') AND descripcionanuncio LIKE CONCAT('%', TRIM(IF(LENGTH(TRIM('$descr')) > 0, '$descr', descripcionanuncio)), '%') ";
echo $query_Recordset1; //para ver consulta por pantalla
?>