Welcome Guest, Not a member yet? Register   Sign In
Database
#1

[eluser]Unknown[/eluser]
I am trying to print out a field which contains the markup for a webpage. The field is a varchar(max). I am using SQL SERVER 2005 with the odbc driver rather than ms sql driver as that gives me a blank screen.

When i try to echo the field on the page

if ($row->copy_for_page != "") {
echo "<p><strong>". strtoupper($row->city). " &ndash; " . $row->rel_date . " &ndash; </strong>". $row->copy_for_page;
}

It prints roughly first 4000 characters of field after that start to print the database class like so:

&ldq;��������a����/** * Database Result Class * * This is the platform-independent result class. * This class will not be called directly. Rather, the adapter * class for the specific database will extend and instantiate it. * * @category Database * @author ExpressionEngine Dev Team * @LinK http://ellislab.com/codeigniter/user-guide/database/ */�fq��a���Y P�O ������������Y ���� �������������x�O x�O ��Z Q�Һ�������������������O ��O X�O ��L ����������������������O ��O �O ��L `����������������������������������L �������4�Y ���������������������������L �����������������������������������������������������������������������������������������������������������������L ���R��@�Y V������)���q�������O ���T������������Y ����1���)�����������������������������h�Y ������)���1�����������������������������������A���)�����G&�����Y ��O ��O x�O x�O ����result_object�����������A���A�����G&����Y ����X�O �O �O ����result_object�����������)���A������x�O �����G&����������Y ����)���)��������O ����JE����������Y ����)���)������`?N ���_&�����������Y ����)���)�������"X ���69G�����������Y ��������)���/** * Query result. Acts as a wrapper function for the following functions. * * @access public * @param string can be "object" or "array" * @return mixed either a result object or array */��������)��������@N ����H>[ �������������Q �Q ����)���X�P ����]v������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������)���������������������������������������A���)�����G&�����Y ������O x�O ��������result_object���������������A������XAX ��Y ��������������������v�uN `dZ "���"�����Y ���������pHX ������������������������������L <���R���0�V \�������������������������������XvN ���=z�|

I am not sure why this is happening and I can't seem to find anything on the internet regarding this.

I would really appreciate and input/suggestion to get this working.

Many thanks
#2

[eluser]imn.codeartist[/eluser]
[quote author="The Coder" date="1253576980"]I am trying to print out a field which contains the markup for a webpage. The field is a varchar(max). I am using SQL SERVER 2005 with the odbc driver rather than ms sql driver as that gives me a blank screen.

When i try to echo the field on the page

if ($row->copy_for_page != "") {
echo "<p><strong>". strtoupper($row->city). " &ndash; " . $row->rel_date . " &ndash; </strong>". $row->copy_for_page;
}

It prints roughly first 4000 characters of field after that start to print the database class like so:

&ldq;��������a����/** * Database Result Class * * This is the platform-independent result class. * This class will not be called directly. Rather, the adapter * class for the specific database will extend and instantiate it. * * @category Database * @author ExpressionEngine Dev Team * @LinK http://ellislab.com/codeigniter/user-guide/database/ */�fq��a���Y P�O ������������Y ���� �������������x�O x�O ��Z Q�Һ�������������������O ��O X�O ��L ����������������������O ��O �O ��L `����������������������������������L �������4�Y ���������������������������L �����������������������������������������������������������������������������������������������������������������L ���R��@�Y V������)���q�������O ���T������������Y ����1���)�����������������������������h�Y ������)���1�����������������������������������A���)�����G&�����Y ��O ��O x�O x�O ����result_object�����������A���A�����G&����Y ����X�O �O �O ����result_object�����������)���A������x�O �����G&����������Y ����)���)��������O ����JE����������Y ����)���)������`?N ���_&�����������Y ����)���)�������"X ���69G�����������Y ��������)���/** * Query result. Acts as a wrapper function for the following functions. * * @access public * @param string can be "object" or "array" * @return mixed either a result object or array */��������)��������@N ����H>[ �������������Q �Q ����)���X�P ����]v������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������)���������������������������������������A���)�����G&�����Y ������O x�O ��������result_object���������������A������XAX ��Y ��������������������v�uN `dZ "���"�����Y ���������pHX ������������������������������L <���R���0�V \�������������������������������XvN ���=z�|

I am not sure why this is happening and I can't seem to find anything on the internet regarding this.

I would really appreciate and input/suggestion to get this working.

Many thanks[/quote]

What is you input can you please paste as I am seeing its character code problem
#3

[eluser]Unknown[/eluser]
I figured out the problem. It seems when using ODBC connection with MS SQL it doesn't seem to print anything over 4000 characters. To print this we decided use sqlsrv_connect instead of odbc and that seems to be retrieving and printing the varchar(max) correctly.




Theme © iAndrew 2016 - Forum software by © MyBB