View Single Post
Old 05-29-2022, 04:50 PM  
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,123
Is there a quicker / easier way to do this?

Quote:
<?php

$con=mysqli_connect "localhost","maindata","pass","user");
$result=mysqli_query("SELECT * FROM Recipe WHERE Category REGEXP 'diabetic'");
$data=mysqli_fetch_assoc($result);
echo $data['total'];

?>
I'm trying to display a recipe count at the top of a page based on how many 'diabetic' friendly recipes I have in my database, but for some reason can't get the code above working.

Is there an easier way to do this that I'm missing?
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote