Buscador php y mysql

Hola estoy realizando una pagina web para una inmobiliaria pero no me funciona el codigo no se que estoy haceindo mal.
Lo estoy desarrolando en dreamweaver y tengo un localhost donde tengo mi base de datos
el scrip donde esta el formulario de busqueda
<?php require_once('Connections/centrica.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? Stripslashes($theValue) : $theValue;
  }
  $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":
      $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;
}
}
mysql_select_db($database_centrica, $centrica);
$query_busqueda = "SELECT * FROM propiedades";
$busqueda = mysql_query($query_busqueda, $centrica) or die(mysql_error());
$row_busqueda = mysql_fetch_assoc($busqueda);
$totalRows_busqueda = mysql_num_rows($busqueda);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Documento sin título</title>
</head>
<body>
<form action="resultado.php" method="post" name="busqueda" id="busqueda">
  <label for="buscarciudad"></label>
<table width="360" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1"><label for="buscarzona"></label></td>
<td width="211"><label for="buscarciudad2"></label>
        <select name="buscarciudad" id="buscarciudad2">
          <option value="bogota" <?php if (!(strcmp("bogota", $row_busqueda['ciudad']))) {echo "selected=\"selected\"";} ?>>Bogota</option>
          <option value="santa marta" <?php if (!(strcmp("santa marta", $row_busqueda['ciudad']))) {echo "selected=\"selected\"";} ?>>Santa MArta</option>
      </select>
        <select name="buscarzona" id="buscarzona">
          <option value="noroccidente" <?php if (!(strcmp("noroccidente", $row_busqueda['zona']))) {echo "selected=\"selected\"";} ?>>Noroccidente</option>
      </select>
      <input type="submit" name="buscar" id="buscar" value="Enviar"></td>
<td width="10"> </td>
<td width="1"><label for="buscar"></label></td>
<td width="22"> </td>
</tr>
</table>
</form>
</body>
</html>
<?php
mysql_free_result($busqueda);
?>
scrip donde esta el resultado
<?php require_once('Connections/centrica.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? Stripslashes($theValue) : $theValue;
  }
  $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":
      $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;
}
}
$maxRows_resultado = 10;
$pageNum_resultado = 0;
if (isset($_GET['pageNum_resultado'])) {
  $pageNum_resultado = $_GET['pageNum_resultado'];
}
$startRow_resultado = $pageNum_resultado * $maxRows_resultado;
mysql_select_db($database_centrica, $centrica);
$query_resultado = "SELECT * FROM propiedades WHERE propiedades.ciudad AND propiedades.zona  ORDER BY propiedades.ciudad, propiedades.zona";
$query_limit_resultado = sprintf("%s LIMIT %d, %d", $query_resultado, $startRow_resultado, $maxRows_resultado);
$resultado = mysql_query($query_limit_resultado, $centrica) or die(mysql_error());
$row_resultado = mysql_fetch_assoc($resultado);
if (isset($_GET['totalRows_resultado'])) {
  $totalRows_resultado = $_GET['totalRows_resultado'];
} else {
  $all_resultado = mysql_query($query_resultado);
  $totalRows_resultado =...

1 Respuesta

Respuesta
1
Prueba usando un conex y usa include para insertarlo, no esta línea
<?php require_once('Connections/centrica.php'); ?>
Y que ambos archivos estén en el mismo directorio

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas