note 51039 added to function.odbc-result

From: Date: Thu, 17 Mar 2005 18:51:35 +0000
Subject: note 51039 added to function.odbc-result
Groups: php.notes 
Request: Send a blank email to php-notes+get-86595@lists.php.net to get a copy of this message
I use one store procedure to retrieve value of identifier, other, name, section,data and datecreated coulmns to variable from SQL server table using $odbc_result = odbc_exec($connect,$query); function. After that, I using following code, for($f=1;$f<=odbc_num_fields($odbc_result);$f++) {echo "<td style=\"font-weight:bold\">$f ".odbc_field_name($odbc_result,$f)."</td>";} echo "</tr></table>"; odbc_fetch_row($odbc_result); echo odbc_result($odbc_result,1)."<br>"; echo odbc_result($odbc_result,2)."<br>"; echo odbc_result($odbc_result,3)."<br>"; echo odbc_result($odbc_result,4)."<br>"; echo odbc_result($odbc_result,5)."<br>"; echo odbc_result($odbc_result,6)."<br>"; The result is as following, 1 identifier 2 other 3 name 4 section 5 data 6 datecreated id1 other2 name3 section4 Warning: odbc_result() [function.odbc-result]: SQL error: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index, SQL state S1002 in SQLGetData in d:\lawdepot_test\contracts\common\LicensingSQL.php on line 630 2005-03-16 18:12:00 I can not get "data"(Text column) back. Firstly, I think "data" column is too long for odbc_result($odbc_result,5) function, but after I check my old colde, I found I can get the "data" back using same function odbc_result(). I would like to hear any suggestions from you. Depressed on this question. Michael ---- Manual Page -- http://www.php.net/manual/en/function.odbc-result.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+51039 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51039&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51039&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51039&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51039&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51039&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+51039&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#86595) next »