我正在尝试使用无DNS连接从MS SQL添加列名;我已使用无dns代码成功连接,但我还需要打印列名。
echo "<table>";
while (!$rs->EOF) //carry on looping through while there are records
{
echo "<tr>";
for ($i=0; $i < $num_columns; $i++) {
echo "<td>" . $fld[$i]->value . "</td>";
}
echo "</tr>";
$rs->MoveNext(); //move on to the next record
}
echo "</table>"; //close the connection and recordset objects freeing up resources我知道如何修改表格,但如何添加表格名称?
发布于 2017-06-08 07:35:48
通过您的代码,很难知道如何填充变量$fld。
我建议您看看获取MS SQL here的值的不同方法。
如果可以使用mssql_fetch_assoc,则数组的关键字是字段(列)名称。
https://stackoverflow.com/questions/13750081
复制相似问题