开发者

How could I make simple row selections from a database with Boole operations?

开发者 https://www.devze.com 2023-03-29 21:11 出处:网络
I have a search engine. I would like to select rows from my table with boolean operations when a user types in a search term. Should I use

I have a search engine. I would like to select rows from my table with boolean operations when a user types in a search term. Should I use

explode(); 

or maybe

split();

?

I would like to use the "OR" operator for selecting开发者_开发百科 the rows.


PHP's split() function is deprecated. Don't use it. Instead, try explode(), str_split(), or preg_split().

If you're using a SQL database, such as MySQL or PostgreSQL, test with UNION and UNION ALL instead of OR. You might be surprised.

0

精彩评论

暂无评论...
验证码 换一张
取 消