mh Posted December 27, 2007 Share Posted December 27, 2007 Hi everyone, I'm trying to write a code to perform a search on a website. The code that I wrote works perfectly when I try to search in a 'varchar' column => (it give correct result for words containing apostrophe and not containing apostrophe). However, if I try to search in a 'blob' column, I only get correct result for words not containing apostrophe. PS: I'm using the : mysql_real_escape_string can anyone help? thx in advance! Link to comment https://forums.phpfreaks.com/topic/83345-apostrophe-in-blob/ Share on other sites More sharing options...
shocker-z Posted December 27, 2007 Share Posted December 27, 2007 Could you show a sample of your code please? You've shown that your using => but as far as i know that would only return a true result on numeric fields.. (maby i will learn somthing new.) If yous looking inside a blob you would generally use "SELECT FROM * WHERE field LIKE '%".$_POST['formfield']."%'" Regards Liam Link to comment https://forums.phpfreaks.com/topic/83345-apostrophe-in-blob/#findComment-424025 Share on other sites More sharing options...
mh Posted December 27, 2007 Author Share Posted December 27, 2007 no i'm not using ' => ' in my code, I just wrote it here so i can explain what i mean by saying "it works perfectly". This is a sample of my code: $keyword = mysql_real_escape_string($keyword); $query="SELECT ID FROM Articles WHERE $columname LIKE '%$keyword %' ; where $keyword is the word that I'm searching for. If $columname, is a varchar, than everything works fine. But if it's a blob then it only works when $keyword contains no apostrophe. thx for ur reply Link to comment https://forums.phpfreaks.com/topic/83345-apostrophe-in-blob/#findComment-424032 Share on other sites More sharing options...
mh Posted December 27, 2007 Author Share Posted December 27, 2007 To be more precise it's a longblob not a blob cloumn Link to comment https://forums.phpfreaks.com/topic/83345-apostrophe-in-blob/#findComment-424043 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.