0

I have two table data as:
- table Classifieds
id | title | body | city | district|
- table Locations
id | label
Relationship
City of table Classifieds is Id two Locations
Now I want using Fulltext Search when users enter keyword (title, body, label(USA, Canada...)) then it will return records by keyword users enter.

4
Contributors
6
Replies
23
Views
3 Years
Discussion Span
Last Post by diafol
0

I'm working on a project with MYSQL and FW PHP Laravel where I believe full-text search is the best way to go. Imagine the following table structure:
Classifieds
id
title
boby
location_id
Location
id
label
Classified

ID  Title   Body    Location_id
1   ABC     ABCD    1
2   BCD     BCDE    2
3   ABC     ABCD    1
4   BCD     BCDE    3

Location

ID  Label
1   USA
2   Italia
3   Canada

As you can see. Now i want when users one keywork (USA) and will it show all recoders has keywork USA.

0

Can't you write down an JOIN query ? Like below:

SELECT c.*, l.Label AS Location FROM Classifieds AS c JOIN location AS l ON c.Location_id = l.ID WHERE l.Label LIKE '%USA%'
0

In this case, I have a search input box. When users enter a title, body, or label, it will also find recoder containing such information. And the only way I used to work fulltext search with it instead of using not Like

0

So what specifically do you need? AN example of fulltext in SQL? Did you check the online mysql manual?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.