malikah Posted November 25, 2007 Share Posted November 25, 2007 Hi, I'm trying to load some text into a database using LOAD DATA but when it reads a sentence with an apostrophe, the sentence gets cut off. For example: 123 , asdf , blah blah blah it's blah , would read: 123 , asdf , blah blah blah it By the way - I'm using the textfield boxes on PHP MyAdmin to import - not MySQL code. Any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/78792-solved-load-data-misinterprets-my-text/ Share on other sites More sharing options...
~n[EO]n~ Posted November 25, 2007 Share Posted November 25, 2007 You should try searching in PHPMyAdmin forum or in their online reference manual. Quote Link to comment https://forums.phpfreaks.com/topic/78792-solved-load-data-misinterprets-my-text/#findComment-398747 Share on other sites More sharing options...
nuxy Posted November 25, 2007 Share Posted November 25, 2007 My suggestion is that they're query is in single quotes, thus cutting it of. Try making your own php script to do this. Also try the LOAD_FILE() function in mysql(root only). <?php $query = mysql_query("UPDATE TABLE `table` SET `cell` = LOAD_FILE('data.txt')"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/78792-solved-load-data-misinterprets-my-text/#findComment-398783 Share on other sites More sharing options...
rarebit Posted November 25, 2007 Share Posted November 25, 2007 If your going to amend their code then have at look at these functions: http://uk3.php.net/manual/en/function.addslashes.php or http://uk3.php.net/manual/en/function.mysql-escape-string.php I generally create a wrapper for GET and POST, in it i use one... (read their notes for which in each circumstance) Quote Link to comment https://forums.phpfreaks.com/topic/78792-solved-load-data-misinterprets-my-text/#findComment-398832 Share on other sites More sharing options...
malikah Posted November 25, 2007 Author Share Posted November 25, 2007 I solved the problem: There are two types of apostrophes - hard to tell the difference unless you look close. I pasted the text into Microsoft Excel 2007, then deleted the apostrophes and retyped them - it uploaded and appeared without any unexpected line cut-offs or breaks. Quote Link to comment https://forums.phpfreaks.com/topic/78792-solved-load-data-misinterprets-my-text/#findComment-398834 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.