[prev in list] [next in list] [prev in thread] [next in thread]
List: php-db
Subject: [PHP-DB] Re: How do I use chunks for nText fields?
From: David Balch <david.balch () conted ! ox ! ac ! uk>
Date: 2007-03-23 14:34:35
Message-ID: loom.20070323T145736-690 () post ! gmane ! org
[Download RAW message or body]
Frank M. Kromann <frank <at> kromann.info> writes:
>
> Keep calling odbc_resilt() untill everything is returned:
>
> $str = "";
> while ($tmp = odbc_result($rs, $column)) {
> $str .= $tmp;
> }
>
> You can also use odbc_longreadlen() to set the number of bytes returned by
> each call to odbc_result().
>
> - Frank
Hi Frank,
I'm not having any luck with this - using odbc_result() (code below)
I get "PHP has encountered an Access Violation".
It seems to me that the database is sending something it shouldn't
(maybe a memory pointer?), and PHP isn't able to do anything with it.
Does that make sense?
Cheers,
Dave.
----8<---
<?php
header('Content-Type: text/plain;');
$connection = odbc_connect("DSN=xxx;UID=xxx;PWD=xxx","","");
$courseId = 'O07P101COD';
// Database query
$query = "SELECT Refunds FROM vwCourses WHERE CourseID = '".$courseId."'";
$rs = odbc_exec($connection, $query);
$refunds = odbc_result($rs, "Refunds");
echo $refunds;
?>
----8<---
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic