I am building an application in Laravel. And I can't decide to go with Match()
or Like
for text searching.
I only want to do a text search on one column, that is a Varchar(42)
.
I will also filter out the query by some Where()
statements, so it will not do a text search on all rows.
I am using mysql 5.6+ so Match works with my innobd engine.
Does Match() do good in a table that has about 30k rows?
Laravel ORM doesnt support match so my query looks like this:
$q = Input::get('query'); Post::whereRaw("MATCH(title) AGAINST(? IN BOOLEAN MODE)", array($q))->get();
Do I need to sanitize the "$q" in order to be safe from SQL injections? Since I'm using whereRaw()
Aucun commentaire:
Enregistrer un commentaire