Código PHP:
Ver original
<?php $_GET['field']='Id'; } 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; } } $currentPage = $_SERVER["PHP_SELF"]; $maxRows_Recordset1 = 10; $pageNum_Recordset1 = 0; $pageNum_Recordset1 = $_GET['pageNum_Recordset1']; } $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1; $colname_Recordset1 = "-1"; $colname_Recordset1 = $_GET['ciudad']; } $colpara_Recordset1 = "-1"; $colpara_Recordset1 = $_GET['zona']; } $coltype_Recordset1 = "-1"; $coltype_Recordset1 = $_GET['tipo']; } $colrang_Recordset1 = "-1"; $colrang_Recordset1 = $_GET['rango']; } $query_Recordset1 = sprintf("SELECT inmuebles.id, inmuebles.foto_a, inmuebles.foto_b, inmuebles.foto_c, inmuebles.foto_d, inmuebles.foto_e, inmuebles.foto_f, inmuebles.ciudad, inmuebles.zona, inmuebles.barrio, inmuebles.direccion, inmuebles.tipo, inmuebles.valor, inmuebles.rango, inmuebles.area, inmuebles.habitaciones, inmuebles.codigo_inm, inmuebles.obs FROM inmuebles WHERE inmuebles.ciudad LIKE %s AND inmuebles.zona LIKE %s AND inmuebles.tipo LIKE %s AND inmuebles.rango LIKE %s ORDER BY " .$_GET['field']." ".$_GET['order'], GetSQLValueString($colname_Recordset1, "text"),GetSQLValueString($colpara_Recordset1, "text"),GetSQLValueString($coltype_Recordset1, "text"),GetSQLValueString($colrang_Recordset1, "text")); $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1); $totalRows_Recordset1 = $_GET['totalRows_Recordset1']; } else { } $queryString_Recordset1 = ""; foreach ($params as $param) { } } } } $queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1); ?>