I talked with a co-worker and I am curious if you have the time to peek at a brief code snipit and see if something is off.
<?php
putenv("TDSDUMP=/tmp/tds.log");
putenv("SYBASE=/usr/local/freetds");
putenv("TDSVER=70");
$hostname = "oms";
$username = "actual_username";
$password = "actual_password";
$dbName = "trr";
$db = mssql_connect($hostname,$username,$password);
mssql_connect($hostname,$username,$password) or DIE("SERVER FAILED TO RESPOND.");
mssql_select_db($dbName,$db ) or DIE("Database unavailable");
$result = mssql_query("SELECT TOP 10 account,mainphone,fax FROM account where account like '$acctLookup%'",$db) or DIE("Query Failed");
echo "<table border=0 cellpadding=2 cellspacing=2>\n";
echo "<tr bgcolor=\"lightblue\"><th>Account Name</th><th>Main Phone</th><th>Fax</th></tr>\n";
while ($myrow = mssql_fetch_array($result)) {
printf("<tr> <td>%s</td> <td>%s</td> <td>%s</td> </tr>\n",
$myrow[account],$myrow[mainphone],$myrow[fax]);
echo("<p>");
}
?>
And here is the output I get from some bogus data I threw into a development table. Note the repeating fax number. Only two companies actually have fax numbers. The others are null values.
Account Name, Main Phone, Fax
Acme Shoes, 636-940-1002,
Wal-Mart, 647-323-1800, 647-323-1900
GAP, 212-455-1333, 212-455-1300
PJ Milligan, 805-690-4800, 212-455-1300
A-Z Used Cars, 314-723-0500, 212-455-1300
Best Locksmith, 958-272-0110, 212-455-1300