Jump to content

Searching over Multiple Table Rows

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Bioshox

Bioshox

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 207 posts
Is there any way you can execute this?

For example, say if I was searching for a product and I had 3 rows.

Brand | Model | Series.

And the user typed in ASUS G43, it would throw out results that were in both the Brand and Model Tables.

Is there any way I can execute this, what type of paramiters/string would I use?

#2
LuthfiHakim

LuthfiHakim

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 765 posts
Actually there is nothing special for this case. In "WHERE" part of your query, just combine the conditions for both fields with OR (and I recommend "LIKE" instead of "=" for both conditions). And perhaps you would prefer to use SELECT DISTINCT to avoid the possibility of duplicate entries in the returned rows.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users