Database query statement select question.

Asked 2 years ago, Updated 2 years ago, 116 views

I want to search using SELECT statement in php file, but if the value of the search is title and the title part of the database is 'Jeju Rape Flower Festival' and only 'Jeju Island' can I get a query that shows that it is 'Jeju Rape Flower Festival'? Is this right? SELECT *FROM 'db' WHERE 'title' = $'title'";

database querying

2022-09-22 21:35

2 Answers

You can use the LIKE operator to query what you want. Please put the appropriate value in table_name and column.

 SELECT * FROM table_name WHERE column LIKE 'Jeju %'

For more usage examples related to the LIKE operator, see the following link:

Alternatively, it can be applied as a code after testing SQL statements online.


2022-09-22 21:35

You can use "LIKE"

SELECT * FROM db WHERE Title = "% Jeju Island%"

If you add a % to the front and back, find the column containing the word

SELECT * FROM db WHERE Title = "%Jeju Island"

If you put % in front of it, it ends in Jeju Island

SELECT * FROM db WHERE Title = "Jeju Island%"

If you put % on the back, you'll find the column that starts with Jeju Island


2022-09-22 21:35

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.