I'm trying to understand how the following statement will execute on multiple records.
SELECT * FROM test
WHERE product='$product'
AND (summary LIKE '%$keywords%' OR exp LIKE '%$keywords%')
ORDER BY `$order_by` DESC;
I'm fairly new to SQL so here's what I'd like to know:
1. When you execute a SQL query, I believe it looks at each row in the table. When a match is found, where does it temporarily store the result until all results can be returned?
2. In the above example, say we're looking at single row in the table and there is a match for summary
. Will the query continue to execute OR exp LIKE '%$keywords%'
when its already found a match?