Jump to content

How do I search my db?


ballhogjoni

Recommended Posts

I have setup a form for the user to search my db for a term but, I don't know how to search all table in my db for the keyword. My code only works for one table:

 

SELECT * FROM `Articles` 
WHERE (`title` REGEXP CONVERT(_utf8 'credit cards' USING latin1) COLLATE latin1_swedish_ci 
OR `tinymcedata` REGEXP CONVERT(_utf8 'credit cards' USING latin1) COLLATE latin1_swedish_ci 
OR `author_id` REGEXP 'credit cards' OR `topic_id` REGEXP 'credit cards' 
OR `display_on_home_page` REGEXP 'credit cards' OR `publish_date` REGEXP 'credit cards' 
OR `meta_title_addition` REGEXP CONVERT(_utf8 'credit cards' USING latin1) COLLATE latin1_swedish_ci 
OR `meta_description_addition` REGEXP CONVERT(_utf8 'credit cards' USING latin1) COLLATE latin1_swedish_ci 
OR `meta_keywords_addition` REGEXP CONVERT(_utf8 'credit cards' USING latin1) COLLATE latin1_swedish_ci)

 

Can anyone show me how to search the entire db for the keyword?

Link to comment
https://forums.phpfreaks.com/topic/129235-how-do-i-search-my-db/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.