Page 1 of 1

PHP and MSSQL through ODBC

Posted: Thu Aug 18, 2005 9:47 am
by graz79
I have a number of tables that contain the Text field type

If we call the field LargeField

Code: Select all

$l_str_query = "SELECT LargeField FROM TABLE";
$l_rst_assign = odbc_exec($g_con_HEAT, $l_str_query) or die ("<p class='txt_error'>Error Occured" . $l_str_query ."</p>");
echo str_replace(chr(13),"<br/>",odbc_result($l_rst_assign,"LargeField"));
Does not display anything but there are not errors

Code: Select all

$l_str_query = "SELECT SUBSTRING(LargeField,1,8000) AS LargeField FROM TABLE";
$l_rst_assign = odbc_exec($g_con_HEAT, $l_str_query) or die ("<p class='txt_error'>Error Occured" . $l_str_query ."</p>");
echo str_replace(chr(13),"<br/>",odbc_result($l_rst_assign,"LargeField"));
Returns the first 8000 characters as I would expect but does bring the data back

Code: Select all

$l_str_query = "SELECT * FROM TABLE";
$l_rst_assign = odbc_exec($g_con_HEAT, $l_str_query) or die ("<p class='txt_error'>Error Occured" . $l_str_query ."</p>");
echo str_replace(chr(13),"<br/>",odbc_result($l_rst_assign,"LargeField"));
Returns the full text

Obviously I do not want to limit the length of the TEXT field to 8000 characters (It is a TEXT field for a reason), similarily I do not want to have to bring back all the fields all the time.

I have tried to put the select statement into a SQL View or Stored Procedure but these bring back nothing either!

I have ammended the PHP.ini to allow the full 2gb TEXT field limit through.

Can someone please help or give guidance as to what I am missing.

Thanks

Posted: Tue Aug 30, 2005 7:56 am
by graz79
nobody got any suggestions this is driving me mad!