sql server - Error returning SQL results via PHP into a html table -
i'm having issues below code, returns first 2 rows , throws sql exception error (see below). first row returned has spaces, second not not , remaining 6 or 7 rows not return. tell me i'm doing wrong? query works ok if excecute in management studio.
thanks
$tracedbcon = mssql_connect("dbaddress", "username", "password") or die("couldn't connect sql db"); $result = mssql_query ("select loadindex, palletno1, palletno2, palletno3, palletno4 [loadmanifest].[dbo].lm_lines lmheaderid = $lmheaderid order loadindex asc", $tracedbcon); echo "<table>"; while($row = mssql_fetch_array($result)){ echo "<tr><td>" . $row['loadindex'] . "</td><td>" . $row['palletno1'] . "</td><td>" . $row['palletno2'] . "</td><td>" . $row['palletno3'] . "</td><td>" . $row['palletno4'] . "</td></tr>"; echo "</table>"; 1 15322832 15322832 15322832 15322832 219758646197586461975864619758646 warning: mssql_fetch_array(): 3 not valid ms sql-result resource in c:\xampp\htdocs\filename.php on line 52
Comments
Post a Comment