Hola, buenas noches / días.
Finalmente monté este código, funciona correctamente en la busqueda de palabras de un mismo campo, pero, todavía no encuentro la manera de hacer una búsqueda múltiple en distintos campos.
Gracias.
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;
}
}
$var1_obtenerCita = "-1";
if (isset($_POST["terminoBusca"])) { $var1_obtenerCita = $_POST["terminoBusca"];
}
$query_obtenerCita = sprintf("SELECT * FROM contactos WHERE contactos.descripcionanuncio LIKE %s ORDER BY contactos.descripcionanuncio ", GetSQLValueString
("%" . $var1_obtenerCita . "%", "text")); $totalRows_obtenerCita = mysql_num_rows($obtenerCita);$var1_obtenerCita = "-1"; if (isset($_POST["terminoBusca"])) { $var1_obtenerCita = $_POST["terminoBusca"];
}
$query_obtenerCita = sprintf("SELECT * FROM contactos WHERE contactos.descripcionanuncio LIKE %s ORDER BY contactos.fechaentrada DESC ", GetSQLValueString
("%" . $var1_obtenerCita . "%", "text")); ?>
<body>
<form id="form1" name="form1" method="post" action="">
<label>Palabras clave:
<input type="text" name="terminoBusca" id="terminoBusca" />
</label>
<input type="submit" name="Buscar" id="Buscar" value="Buscar" />
<strong><a href="buscar por palabra clave.php"></a></strong><strong><a href="buscar por palabra clave.php"></a></strong>
</form>
<?php do { ?>
<a href="fichas_comentarios.php?idempleado=
<?php echo $row_obtenerCita['idempleado']; ?>">
<?php echo ucfirst($row_obtenerCita['tituloanuncio']); ?></a>
<p>
<a href="fichas_comentarios.php?idempleado=<?php echo $row_obtenerCita['idempleado']; ?>"></a>
</p>
<p> </p>
<p align="center"> </p>
<p align="center"> </p>
</body>
</html>
<?php
?>