Display all fields & Data from MSSQL
Posted: Mon Dec 04, 2006 9:48 am
Hi
I have this code which displays a particular field ("field1") from a MSSQL database
How do I display all the fields in the DB along with their corresponding data.
Thanks
Geoff
I have this code which displays a particular field ("field1") from a MSSQL database
Code: Select all
<?php
error_reporting(E_ALL);
$server="server";
$username="administrator";
$password="***";
$db = "SQL";
$table = "table";
$sqlconnect=mssql_connect($server, $username, $password);
$sqldb=mssql_select_db($db,$sqlconnect);
$sqlquery="SELECT * FROM $table;";
$results= mssql_query($sqlquery);
while ($row=mssql_fetch_array($results)){
echo $row['field1']."<br>\n";}
mssql_close($sqlconnect);
?>Thanks
Geoff