I'm trying to count how many times the word "ItzBenji" is listed in the database
But i have no clue what so ever, on how to do it :(
It's a woocommerce table, of "order_items" and i want to count how many times the specific Coupon code is used. How can i do that I tried this i found online:
$sql = "select * from wp_woocommerce_order_items"; //Select All
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result)) {
if($row['order_item_name'] == itzbenji)
{
echo "test";
}
}
But that did not work :(
How to do it? And make it echo a number like "It is used 3 times"