bluedot Posted February 8, 2007 Share Posted February 8, 2007 Hi, I have a search script that the user chooses to search under 1 of 3 columns (author, source, quote). author and source are "varchar" columns, and if i choose one of those 2 to search in it works fine. However quote is a "blob" column as I allow some formating in this column. If i put a test row in the database with no formating in the quote column it can be found by the search just fine. But if there is any text that is formated can't be found. Im guessing this is due to the way blobs are stored, so my question is how do I query it? This is my current query: <?php $find = strtoupper($find); $find = strip_tags($find); $find = trim ($find); $data = mysql_query("SELECT * FROM quotes WHERE upper($conditions) LIKE'%$find%'", $hd); ?> $find is what they searched for, and $conditions is where what column they wanted to search in. Thank you. Link to comment https://forums.phpfreaks.com/topic/37687-querying-a-mysql-blob/ Share on other sites More sharing options...
btherl Posted February 9, 2007 Share Posted February 9, 2007 What do you mean by "formatted" ? Link to comment https://forums.phpfreaks.com/topic/37687-querying-a-mysql-blob/#findComment-180420 Share on other sites More sharing options...
bluedot Posted February 9, 2007 Author Share Posted February 9, 2007 like bold or or italics or centering Link to comment https://forums.phpfreaks.com/topic/37687-querying-a-mysql-blob/#findComment-180955 Share on other sites More sharing options...
camdagr81 Posted February 9, 2007 Share Posted February 9, 2007 try changing the field type to LONGTEXT instead of a blob. You should be able to have the same performance level w/o having to change any of your insert commands. This will also make the field fulltext so you should be able to search it. With blob, the encoding is different, thus not searchable w/o changing the encoding of your LIKE. Link to comment https://forums.phpfreaks.com/topic/37687-querying-a-mysql-blob/#findComment-180972 Share on other sites More sharing options...
bluedot Posted February 9, 2007 Author Share Posted February 9, 2007 Thank you very much! that fixed it. Link to comment https://forums.phpfreaks.com/topic/37687-querying-a-mysql-blob/#findComment-181003 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.