510 posts
  • Beta Tester
  • Bought between 10 and 49 items
  • Contributed a Tutorial to a Tuts+ Site
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 1 000 and 5 000 dollars
pxt says

Hi there,

I’ve just started to use MySQLi (I normally just use MySQL Connect, etc) and have encountered a problem.

If I fetch some data from a table, even if the field is of the type ‘text’, it is truncated to a maximum of 256 characters.

Someone else is having a similar issue: http://www.jodymickey.com/?p=38

Any help is appreciated!

510 posts
  • Beta Tester
  • Bought between 10 and 49 items
  • Contributed a Tutorial to a Tuts+ Site
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 1 000 and 5 000 dollars
pxt says

bump

Any ideas about this?

409 posts
  • Exclusive Author
  • Has been a member for 4-5 years
  • India
Dhruv says

Sorry, but i don’t have any idea about this,

You can try posting it here : http://www.stackoverflow.com, you will get answers within minutes.

2529 posts
  • Attended a Community Meetup
  • Author had a Free File of the Month
  • Blog Editor
  • Bought between 50 and 99 items
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Has been a member for 5-6 years
+6 more
JeffreyWay says

It’s got to be an issue on your end. MySQLi doesn’t truncate the results, unless you specify so. Can you paste in some code?

128 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 500 and 999 users
jackpotsoft says

may be its an input validation

text datatype is too big , cant be limited at 256

You can also Try Blob. Make sure , Input is not being processed some where.

510 posts
  • Beta Tester
  • Bought between 10 and 49 items
  • Contributed a Tutorial to a Tuts+ Site
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 1 000 and 5 000 dollars
pxt says

I’ll just put an example up on github in a second and post a link here…

510 posts
  • Beta Tester
  • Bought between 10 and 49 items
  • Contributed a Tutorial to a Tuts+ Site
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 1 000 and 5 000 dollars
pxt says

Here’s the link: https://github.com/Pexat/MySQLiTesting-TEMP-

There’s also a mysql dump of the test database in there

Thanks for all the help!

510 posts
  • Beta Tester
  • Bought between 10 and 49 items
  • Contributed a Tutorial to a Tuts+ Site
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 1 000 and 5 000 dollars
pxt says

Has anyone had a chance to look at this?

2 posts
  • Bought between 1 and 9 items
  • Has been a member for 3-4 years
Altrea says

I have tested your script on my localhost. Both scripts gave me the exact the same output:

“Number of characters in body field: 3493”

So the problem must be somewhere else.

409 posts
  • Exclusive Author
  • Has been a member for 4-5 years
  • India
Dhruv says

It’s working perfectly (tested on localhost).

Which version of PHP and MySQL are you using??

Are you sure you are using the exact same code which you uploaded on GitHub?

by
by
by
by
by
by