Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 73845

How do I check if a column is empty in MySQL php?

$
0
0
$query = $db->query("SELECT * FROM recipes WHERE username='".$_SESSION['username']."'");

<h1>my recipes</h1>     
<?php
while ($row = $query->fetch_assoc()) {              
print "<p><a href='../table/show_recipe.php?id=".$row['id']."'>".$row['name']."</a></p>";
}       
?>

I have a question Which command should be added if there are no user recipes yet Will the message "No recipes currently exist" be printed? Thanks for the help


Viewing all articles
Browse latest Browse all 73845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>