defreez Posted January 29, 2011 Share Posted January 29, 2011 need your suggestion here is my problem i have field varchar(1000) in my sql server 2008 DB but if i mssql_fetch_object($result) my field value truncated and only show 256 character, why ? in my DB . my field value really 1000 character long . Quote Link to comment https://forums.phpfreaks.com/topic/226072-why-my-varchar1000-value-truncated-in-php/ Share on other sites More sharing options...
Pikachu2000 Posted January 29, 2011 Share Posted January 29, 2011 You'll need to post your code that retrieves the record, and any other relevant information. Since this sounds like a PHP problem, rather than a problem with MSSQL, moving thread to PHP help . . . Quote Link to comment https://forums.phpfreaks.com/topic/226072-why-my-varchar1000-value-truncated-in-php/#findComment-1167039 Share on other sites More sharing options...
defreez Posted January 29, 2011 Author Share Posted January 29, 2011 thx for ur response , i post here because i thought relevance mssql and php, sorry if im wrong here is my code ...... $query=" select top 1 content from table_msg where id='1234' "; result=mssql_query($query,$dbConn) $row=mssql_fetch_object($this->result); print_r($row->content); ....... //this only 256 character printed but in db 1000 character environment mssql server 2008 apache 2.2 php 5.2.x freetds version = 4.2 Quote Link to comment https://forums.phpfreaks.com/topic/226072-why-my-varchar1000-value-truncated-in-php/#findComment-1167048 Share on other sites More sharing options...
ignace Posted January 29, 2011 Share Posted January 29, 2011 When you have a problem related to some functionality your first point: PHP.net manual Quote Link to comment https://forums.phpfreaks.com/topic/226072-why-my-varchar1000-value-truncated-in-php/#findComment-1167078 Share on other sites More sharing options...
spiceweasel Posted January 29, 2011 Share Posted January 29, 2011 I am a relative beginner but from what i understand VARCHAR can be set to a value of between 0-255 in Mysql versions pryor to MySQL 5.0.3 and 0 to 65,535 in later versions. So check you versions also check out Mysql site for futher details: http://dev.mysql.com/doc/refman/5.0/en/char.html Scratch that i didnt read the question correctly (mssql) - Sorry Quote Link to comment https://forums.phpfreaks.com/topic/226072-why-my-varchar1000-value-truncated-in-php/#findComment-1167123 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.