我是新的使用MSSQL和PHP,我想從會話中排序結果,而不是像sort.php?ID的鏈接。任何人都可以幫助我做到這一點?排序會話PHP和MSSQL
這裏是我的代碼:
<body>
<div id="wrapper">
<h1 align="center" >Tickets - Informática</h1>
<table class="tablesorter" id="keywords" cellspacing="0" cellpadding="0">
<thead>
<tr>
<th class="lalign">#</th>
<th>Nome</th>
<th>Idade</th>
<th>Peso</th>
</tr>
</thead>
<tbody>
<?php
$serverName = "asfdasasx-fsadasd";
$options = array( "UID" => "safs", "PWD" => "fsadas", "Database" => "demo");
$conn = sqlsrv_connect($serverName, $options);
if($conn) {
$sql="SELECT * FROM cliente";
$aResult=sqlsrv_query($conn, $sql);
while($rows = sqlsrv_fetch_array($aResult))
{
$id = $rows['id'];
$nome = $rows['nome'];
$idade = $rows['idade'];
$peso = $rows['peso'];
?>
<p>
<td align="center"><b><?php echo $id;?></b></td>
<td align="center"><b><?php echo $nome;?></b></td>
<td align="center"><b><?php echo $idade;?></b></td>
<td align="center"><b><?php echo $peso;?></b></td>
</p>
</tbody>
如何使用SQL查詢進行排序? – Swellar
我已經看到了,我沒有把它工作,所以我要求一些幫助 –
你可以詳細說明'會話'排序結果嗎?我看不到你的代碼中使用了'session' – Swellar