I am pretty sure this has been answered before but I cannot seem to find it.
I have a mysql request, and it is returning only the first half’s results as opposed to all of them as an array.
sql= "SELECT filename, name, keywords FROM `pics` WHERE (keywords LIKE '%chair%' OR '%jeff%') ORDER BY date ASC";
$rows = $db->fetch_all_array($sql);
foreach($rows as $i => $record){
So if I were to run the above code, I get all entries with chair in them but not with jeff… if I switch them around and do '%jeff%' OR '%chair%' I get all entries with jeff in them but not with chair
I am sure I am missing something that is needed with the OR but I cannot figure it out
keywords LIKE '%chair%' OR keywords LIKE '%jeff%'You need to OR the entire condition.