Welcome Guest, Not a member yet? Register   Sign In
Help - I can not retrieve string greater than 255 caracters
#1

[eluser]Pau1inh0[/eluser]
Hello .. I can not retrieve a record of the bd with a number greater than 255 caracters, it happens that the string is cut or the full text has not been on the bench that the text is much greater than those displayed.

thanks!

Olá... não consigo recuperar um registro do banco com um número de caracters maior que 255, acontece que a string vem cortada ou seja o texto não vem completo sendo que no banco o texto é muito maior que o exibido.

Obrigado.

exemple:
$query = $this->db->query("Select * from table");
$query = $query->row_array();
echo $query['field'];

//echo text
//text text text text ... (255 caracters)

// BD
// text text text text ... (1000 caracters)
#2

[eluser]mi6crazyheart[/eluser]
First of all, what is BD!!! . Second, look directly inside DB table field (by: PHP MyAdmin or make make SQL query) for how much data actually u'r DB table content. Is it more than 255 characters or only 255 chars...
#3

[eluser]Pau1inh0[/eluser]
BD SQLSERVER 2008 - field varchar(8000)

The data is recorded normally, the problem is when I recover the data that are brought up to 255 characters.
#4

[eluser]Narkboy[/eluser]
Older versions of SQL only allow varchar(255) - any number above that is just truncated.

Try TEXT or BLOB instead.

/B
#5

[eluser]Pau1inh0[/eluser]
this is not the problem because the data is stored correctly ie with its number of caracters greater than 255, but when stored in the variable and show the screen displays only the string with up to 255 characters.
#6

[eluser]tonanbarbarian[/eluser]
what driver are you using to connect to the database
if you are using odbc you may have the problem
odbc generalises some field types and therefore does some assumptions
sometimes it assumes that a varchar field is only going to be 255 characters and truncates the rest
if possible always use the latest native drivers to connect to the database
#7

[eluser]Pau1inh0[/eluser]
I understood, but there is no driver problem, because if I do the query in my database returns the data correctly ie with All the characters, but by the application when I call the query only returns me the value with 255 characters, I wonder if there is some sort of limitation on the IC on this problem I'm facing.
#8

[eluser]Narkboy[/eluser]
Ok - what database are you using, what version, and what tool do you use that gives you the correct output?

The driver issue is not cleared just because you're getting a correct response from the db. CI uses the driver to connect; if the driver is at fault, then any PHP-based method of querying the db that uses that driver will also give you the same problem.

We'll need details to get this working Smile
#9

[eluser]Pau1inh0[/eluser]
I use sqlserver 2008 and tool is sqlserver 2008 management studio.
#10

[eluser]WanWizard[/eluser]
Working on Windows?

http://www.php.net/manual/en/function.ms...length.php:
"Due to a limitation in the underlying API used by PHP (MS DBLib C API), the length of VARCHAR fields is limited to 255. If you need to store more data, use a TEXT field instead."




Theme © iAndrew 2016 - Forum software by © MyBB