snorky Posted June 7, 2009 Share Posted June 7, 2009 How to INSERT large amounts of text, e.g., up to 64K blobs of any size A regular insert would seem to be the way to do it, but I'm puzzled as to how to manage inserting 64 kb of text. Maybe I could do the following, but it looks like trouble waiting to happen. insert into tablename (lname,fname,location,message,picture,language,beverage) values("Smith","Jane","New York City","[b][i]beginning of text ... 30k more words ... end of text[/i][/b]","","Pepsi-Cola"); Inserting binary data has me stumped completely. Can I use a file path/name instead of text as in insert into tablename (lname,fname,location,picture,language,beverage) values("Smith","Jane","New York City",/public_html/images/person.jpg,"","Pepsi-Cola"); If so, that would also resolve the insert-big-text problem. If the size of inserted file > column length is the file truncated or does it crash the server? Is there a max length of the query? Is there a buffer that holds the characters in the query? If so, is the buffer size adjustable? Does overflowing the buffer crash anything? I can't find any of this in the mysql documentation, and haven't found a coherent article that addresses these questions in a context that I can understand. Of course, the key to getting a good answer is to ask a good question. Hence, my predicament. Yet, this must be a very common issue. Quote Link to comment https://forums.phpfreaks.com/topic/161254-insert-large-text-and-blobs-into-fields/ Share on other sites More sharing options...
dreamwest Posted June 7, 2009 Share Posted June 7, 2009 Make sure "message" column is set to BLOB the rest you can set to VARCHAR 100 Quote Link to comment https://forums.phpfreaks.com/topic/161254-insert-large-text-and-blobs-into-fields/#findComment-850906 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.