Hamurabi Araujo
Hamurabi Araujo

Reputation: 117

Change max size of odbc_exec() return

I'm doing a procedure call to SQL Server from PHP ODBC. One of the fields on the procedure returns has a lot of text. The code runs with no erros, but the text read by odbc in my code comes incomplete.

$result = odbc_exec($db, "{CALL myprocedure(2, 3)}");
while(odbc_num_rows($result)) {
  $m[] = odbc_fetch_array($result);
  var_dump($m);
}

I got this return of var_dump($m):

array(1) { [0]=> array(1) { ["mensagem"]=> string(4096) "

I want change the max size that can get from a field with PHP ODBC. How I can do this from my code?

I don't have access to php.ini file on the server.

Upvotes: 0

Views: 766

Answers (1)

maio290
maio290

Reputation: 6732

According to http://php.net/manual/en/odbc.configuration.php the only variable with 4096 is "odbc.defaultlrl". According to https://stackoverflow.com/a/4500598/4934937, ini_set("odbc.defaultlrl", "100K"); should do the trick.

Upvotes: 1

Related Questions