510 posts
  • 5 Years of Membership
  • Affiliate Level 1
  • Author Level 3
  • Beta Tester
+4 more
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
  • 5 Years of Membership
  • Affiliate Level 1
  • Author Level 3
  • Beta Tester
+4 more
pxt
says

bump

Any ideas about this?

409 posts
  • 5 Years of Membership
  • Exclusive Author
  • 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
  • 6 Years of Membership
  • Affiliate Level 2
  • Author Level 6
  • Blog Interview
+13 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
  • 5 Years of Membership
  • Affiliate Level 6
  • Collector Level 3
  • Exclusive Author
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
  • 5 Years of Membership
  • Affiliate Level 1
  • Author Level 3
  • Beta Tester
+4 more
pxt
says

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

510 posts
  • 5 Years of Membership
  • Affiliate Level 1
  • Author Level 3
  • Beta Tester
+4 more
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
  • 5 Years of Membership
  • Affiliate Level 1
  • Author Level 3
  • Beta Tester
+4 more
pxt
says

Has anyone had a chance to look at this?

2 posts
  • 4 Years of Membership
  • Collector Level 1
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
  • 5 Years of Membership
  • Exclusive Author
  • 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