Ver Mensaje Individual
  #4 (permalink)  
Antiguo 11/11/2010, 04:43
rafaxusirati
 
Fecha de Ingreso: julio-2010
Ubicación: Cerca Sitges (Barcelona)
Mensajes: 98
Antigüedad: 13 años, 9 meses
Puntos: 4
Respuesta: php para consultas

Modificandolo me da error:

Parse error: syntax error, unexpected T_ECHO in /var/www/vhost/.../html/buscar por palabra clave_ejemplo.php on line 36

Con echo $query_Recordset1

Código PHP:
Ver original
  1. <?php require_once('Connections/contactos.php'); ?>
  2. <?php
  3. if (!function_exists("GetSQLValueString")) {
  4. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  5. {
  6.   if (PHP_VERSION < 6) {
  7.     $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  8.   }
  9.  
  10.   $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  11.  
  12.   switch ($theType) {
  13.     case "text":
  14.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  15.       break;    
  16.     case "long":
  17.     case "int":
  18.       $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  19.       break;
  20.     case "double":
  21.       $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  22.       break;
  23.     case "date":
  24.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  25.       break;
  26.     case "defined":
  27.       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  28.       break;
  29.   }
  30.   return $theValue;
  31. }
  32. }
  33.  
  34. mysql_select_db($database_contactos, $contactos);
  35. $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)), "%")  ";
  36. $Recordset1 = echo $query_Recordset1($query_Recordset1, $contactos) or die(mysql_error());
  37. $row_Recordset1 = mysql_fetch_assoc($Recordset1);
  38. $totalRows_Recordset1 = mysql_num_rows($Recordset1);
  39. ?>