Código PHP:
Ver original<?php require_once('Connections/conbanca.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;
}
}
$query_Recordset1 = "SELECT * FROM inmuebles order by $_GET['field'] $_GET['order']";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
</head>
<body>
<form id="form1" name="form1" method="get" action="prueba.php">
<label>
<select name="field" id="field">
<option>Seleccione un campo</option>
<option value="fecha">fecha</option>
<option value="barrio">barrio</option>
<option value="direccion">direccion</option>
<option value="codigo_inm">codigo_inm</option>
</select>
</label>
<label>
<select name="order" id="order">
<option selected="selected">Orden</option>
<option value="ASC">Ascendente</option>
<option value="DESC">Descendente</option>
</select>
</label>
<label>
<input type="submit" name="button" id="button" value="ORDENAR" />
</label>
</form>
<p> </p>
<table width="500" border="1" cellspacing="0" cellpadding="3">
<tr>
<td bgcolor="#909090">FECHA</td>
<td bgcolor="#909090">BARRIO</td>
<td bgcolor="#909090">DIRECCION</td>
<td bgcolor="#909090">CODIGO</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_Recordset1['fecha']; ?></td>
<td><?php echo $row_Recordset1['barrio']; ?></td>
<td><?php echo $row_Recordset1['direccion']; ?></td>
<td><?php echo $row_Recordset1['codigo_inm']; ?></td>
</tr>
</table>
</body>
</html>
<?php
?>