PHP mysql search multiple tables using a keyword

前端 未结 4 687
时光说笑
时光说笑 2020-11-28 04:01

I have three tables in my database which are:

messages
topics
comments

Each of these tables has two fields called \'content\' and \'title\'

4条回答
  •  温柔的废话
    2020-11-28 04:55

    Two search in other tables you use:

    SELECT `categories`.`title`, `posts`.`title` WHERE `categories`.`title` LIKE {$a} OR `posts`.`title` LIKE {$a}
    

    The CATEGORIES and POSTS are tables of your database.

提交回复
热议问题