Código PHP:
<?php
include("con_sql_server.php");
$result=mssql_query("select no_con from usr_ban group by no_con");
echo '<p align="justify"><span class="style39">BANCOS</span><FONT FACE="arial" SIZE="2"><br>';
while ($row=mssql_fetch_array($result)) {
$i=$i+1;
echo $i.'<font color="#999999"><b>'.$row["no_con"].'</b></font><br>';
$var[$i]=$row["no_con"];
}
echo "</TABLE></p></font>";
$con++;
$result=mssql_query(sprintf("select * from usr_ban where no_con=%s", $var[$con]));
echo '<p align="left"><span class="style39">DEPOSITOS</span><FONT FACE="arial" SIZE="2">';
echo '<TABLE CELLPADDING="2" CELLSPACING="2" WIDTH="100%">';
echo '<TR><TD BGCOLOR="#999999"><b>BANCO</b></TD><TD BGCOLOR="#999999"><b>DIA/MES/AÑO</b></TD><TD BGCOLOR="#999999"><b>CUENTA</b></TD></TR>';
while ($row=mssql_fetch_array($result)) {
echo '<TR><TD BGCOLOR="#A9B6AD">'.$row["no_con"].'</TD><TD BGCOLOR="#A9B6AD">'.$row["n_dd"].'/'.$row["n_dm"].'/'.$row["n_da"].'</TD><TD BGCOLOR="#A9B6AD">'.$row["nu_con"].'</TD></TD><TD BGCOLOR="#A9B6AD">'.$row["nu_con"].'</TD>';
echo '</TR>';
}
echo "</TABLE></p></font>";
?>:'(
Warning: mssql_query() [function.mssql-query]: Query failed in C:\xampplite\htdocs\bank_con.php on line 21
DEPOSITOSBANCO DIA/MES/AÑO CUENTA
Warning: mssql_fetch_array(): supplied argument is not a valid MS SQL-result resource in C:\xampplite\htdocs\bank_con.php on line 25