Querying data based on the date - Mysql
<p>I want to display search results queried based on the condition where the from_date is today or upwards and also the to_date is up until today if that exists in the range.</p>

<p>My query is as follows : </p>

<pre><code>SELECT *
FROM device b LEFT OUTER JOIN device_model a
    ON (b.`model_ID`=a.`model_ID`)
LEFT JOIN sub_product_area c
    ON (b.sub_Product_Area_ID = c.sub_Product_Area_ID)
LEFT JOIN borrow_device d
    ON (b.device_ID = d.device_ID AND (from_Date &gt;= CURDATE() or CURDATE() &lt;= to_date))
WHERE (a.`name`LIKE '%galaxy%') OR (a.platform LIKE 'galaxy%') OR
    (a.`type`LIKE '%galaxy%') OR (a.`OS`LIKE '%galaxy%') OR (d.username LIKE '%galaxy%') OR
    (c.`sub_Product_Area_name` LIKE '%galaxy%')
ORDER BY d.`transaction_Mode` DESC
</code></pre>

<p>My table structures are here:</p>

<p><a href="https://i.stack.imgur.com/o0adw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/o0adw.png" alt="enter image description here"></a></p>

<p>The problem is it doesn't display results where the next clause after 'OR' gets true. Is there anything wrong with my query?</p>