note 42072 added to function.odbc-result-all

From: Date: Sun, 02 May 2004 06:12:24 +0000
Subject: note 42072 added to function.odbc-result-all
Groups: php.notes 
Request: Send a blank email to php-notes+get-69097@lists.php.net to get a copy of this message
a revised version marius' code that works with Memo fields. (also returns rather than prints strings) function ODBCResourceToHTML($res, $sTable, $sRow) {$cFields = odbc_num_fields($res); $strTable = "<table $sTable ><tr>"; for ($n=1; $n<=$cFields; $n++) {$strTable .= "<td $sRow><b>". str_replace("_", " ", odbc_field_name($res, $n)) . "</b></td>";} $strTable .= "</tr>"; while(odbc_fetch_row($res)) { $strTable .= "<tr>"; for ($n=1; $n<=$cFields; $n++) {$cell = odbc_result($res, $n); if ($cell=='') {$strTable .= "<td $sRow>&nbsp;</td>";} else {$strTable .= "<td $sRow>". $cell . "</td>";}} $strTable .= "</tr>";} $strTable .= "</table>"; Return $strTable;} DEAR MODERATORS: you would save yourselve much much time by making this entire manual into a wiki (ie like http://en.wikipedia.org ) and within a year this would be the best manual on anything!! best wishes, Erich ---- Manual Page -- http://www.php.net/manual/en/function.odbc-result-all.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+42072 Delete -- http://master.php.net/manage/user-notes.php?action=delete+42072&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+42072&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#69097) next »