<?php $SQL = "select * from objects where objid in (select objid2 from links where objid1 = ".$gr." and ltid = 1)"; $rs = mssql_query($SQL, $conn); $n = 0; while (mssql_fetch_array($rs)) { $SQL = "select * from obs_tables where objid = ".mssql_result($rs,$n,"OBJID").""; $rs1 = mssql_query($SQL, $conn); if ($rs1) { $nomer_table = mssql_result($rs1,0,"OTNUMBER") ; echo "<tr><td>Тариф 2-</td><td bgcolor='#eeeeee'>".$nomer_table."</td><td>КВт*ч</td></tr>"; } $n= $n +1; } mssql_free_result($rs); ?> выдает Warning: mssql_result(): Bad row offset (0) in C:\server\xampp\htdocs\chel\ntm_otch_1.php on line 65 немогу понять почему if ($rs1) не убирает эти строки подскажите в чем ошибка