I have this working statement for searching a single column in my database:
$foods = $wpdb->get_results( $wpdb->prepare( "SELECT id, foodname, namevariations, calories, carbs, fat, protein, sodium FROM foodsTable WHERE namevariations like %s", "%$search_text%"), ARRAY_A );
I would like to include another column in the search called "foodname" but I can't seem to figure out the correct syntax.
How should I formulate my prepare statement so that I'm searching "namevariations" OR "foodname" and a match in either column will select that row?
Thanks!