Hi everyone!
i have this function that reads a whole lot of data with file_get_contents() and should then put i into a mysql table (TEXT column). It seems however that the string is too long.. if you would run mysql_error() during the query, you will get the following error message:
[quote]
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '¡&‘ðùá¨ì{Ÿ‚Q{Š}x
[SOLVED]String too long..
Moderator: General Moderators
[SOLVED]String too long..
Last edited by aye on Wed Apr 11, 2007 1:20 pm, edited 1 time in total.
apply mysql_real_escape_string before using the data string in a sql statement.
If the string were too long mysql would have told you so.
If the string were too long mysql would have told you so.
thanks for your help, forgot that 
Anyhow, it seems like the string is too long still.. now i get the following error instead: "Got a packet bigger than 'max_allowed_packet' bytes". So, my new question: how do you change max_allowed_packet? im on a dedicated server, so access should be no problem
Update: nevermind, i managed to change the max_allowed_packet size by editing my.cnf.
Now i have a new problem though. I'm going to put all the data into a text column, but only a very small amount of the complete text file (~13mb) is put into the column. Seems like there is some restriction of how big a text column can get (only 2-4% of the document is stored). Can i change this somehow?
Anyhow, it seems like the string is too long still.. now i get the following error instead: "Got a packet bigger than 'max_allowed_packet' bytes". So, my new question: how do you change max_allowed_packet? im on a dedicated server, so access should be no problem
Update: nevermind, i managed to change the max_allowed_packet size by editing my.cnf.
Now i have a new problem though. I'm going to put all the data into a text column, but only a very small amount of the complete text file (~13mb) is put into the column. Seems like there is some restriction of how big a text column can get (only 2-4% of the document is stored). Can i change this somehow?