|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1998-04-29 09:56 UTC] kara
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 11:00:02 2025 UTC |
This script displays the fields STATUS (smallint) and DESCRIPTION (longvarchar) from the SYMPTOM table. The data source is of type MS SQL Server. <? $connect_id = odbc_connect("gh", "tma", "password") or die("Unable to connect to SQL server"); $query = "use errorh"; $result = odbc_exec($connect_id, $query) or die( "SQL USE query failed"); if (!$result) { echo "Unable to select database.\n"; return 0; } $query = "select status,description from symptom"; $result = odbc_exec($connect_id, $query) or die( "SQL query failed"); if (!$result) { echo "Unable to perform query.\n"; return 0; } $field_count = odbc_num_fields($result); echo "<table border=1 width=\"95%\"><tr>\n"; while (odbc_fetch_row($result)) { for ($i = 0; $i < $field_count; $i++) { $row[$i] = odbc_result($result, $i+1); } echo "<tr>\n"; for ($i = 0; $i < $field_count; $i++) { echo "<td>"; echo "$row[$i]\n"; echo "</td>"; } } echo "</table>\n"; ?> When run using a PHP3-dev version dated 11-02-98, the BLOB fields are passed through to the client and appear outside the table. When using RC4, *nothing* is displayed. This also happens if I use odbc_binmode() settings of 0, 1 or 2.