Hi All,
I need some help or direction on how make this work.
I have created a script to query a mssql db with success, however I am having trouble with the output.
The table structure is not changeable so I need to work with it as is, below is the table structure and some sample data.
RFQINC ROWCOL ROWHEADER COLHEADER VALUE
100010 1 1 Piece Price Piece Price Piece Price
100010 1 2 Piece Price Standard Standard
100010 2 1 110 Piece Price 110
100010 2 2 110 Standard 153.82
The desired output should be as follows
Piece Price Standard
110 153.82
Basically at each change in row number, the result of value(s) from that row would be output to a new line. Current code is below.
<?php
function left($string, $count){return substr($string, 0, $count);};
myServer = "sql";
$myUser = "";
$myPass = "";
$myDB = "db_Live";
$dbhandle = mssql_connect($myServer, $myUser, $myPass) or die("Couldn't connect to SQL Server on $myServer");
$selected = mssql_select_db($myDB, $dbhandle) or die("Couldn't open database $myDB");
$query = "SELECT * from SpreadsheetOnSave where rfqinc like '100010'";
$result = mssql_query($query);
while($row = mssql_fetch_array($result))
{
echo "Row: $row[Value]<br>";
echo "<br>";
}
Any help would be greatly appericated.
Thanks
BHB