Jump to content

mysql data search help


prakash

Recommended Posts

Hi,

 

I have lots of tables on my database and I need to search all the tables and fields for a specific keywords and list out the data with table fields.

 

Suppose I have 2 tables and following fields as following.

 

table1

===================

field1      field2      field3

===================

aaa        bbb        ccc

bbb        ccc        aaa

ccc        aaa        bbb

 

 

table2

===================

field_a      field_b      field_c

===================

aaa          bbb          ccc

aaa          bbb          ccc

aaa          bbb          ccc

 

so I need to make a query so that I can list out following if searched for keyword 'aaa' it will list out data like:

 

from table1

==============

field1: aaa

field2: bbb

field3: ccc

 

field1: bbb

field2: ccc

field3: aaa

 

field1: ccc

field2: aaa

field3: bbb

 

from table2

==============

field_a: aaa

field_b: bbb

field_c: ccc

 

field_a: aaa

field_b: bbb

field_c: ccc

 

field_a: aaa

field_b: bbb

field_c: ccc

 

so can I use a combined query for all the table or have to do it differently. what will be the query??

Link to comment
https://forums.phpfreaks.com/topic/72204-mysql-data-search-help/
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.