Intento realizar una consulta sobre una base de datos MYSQL (llamada contactos), que tiene varios campos, pero me interesa que la consulta se realice sobre 3 campos ciudad, tituloanuncio, descripcionanuncio, pero me arroja el siguiente error.
Query was empty
Alguna sugerencia, ? o código alternativo para realizar esta consulta?
Gracias.
Rafa.
Código PHP:
Ver original
<?php require_once('Connections/contactos.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": break; case "double": 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)), "%") "; ?>