Monday, September 21, 2015

Displaying SQL Server Column Names in PHP

<?php

$stmt = sqlsrv_query( $conn, $query[0] );
foreach( sqlsrv_field_metadata( $stmt ) as $fieldMetadata  ) {
echo '<td>' .$fieldMetadata['Name'].'</td>';
//foreach( $fieldMetadata as $name => $value) {
 // echo "$name: $value<br />";
//}
// echo "<br />";
}
?>

No comments:

Post a Comment