PHP & MySQL check database if data is entered question

SmiileToday

New Member
I was wondering how can I check if there is no tags entered into the database for a specific post if there are none, display \[code\]no tags have been entered\[/code\]. How can I do this using PHP?Here is my PHP & MySQL code.\[code\]$tag = array();$dbc = mysqli_query($mysqli, "SELECT tags.tag FROM posts_tags INNER JOIN tags ON tags.id = posts_tags.tag_id WHERE posts_tags.post_id = '" . $post_id . "' GROUP BY tags.tag");if (!$dbc) { print mysqli_error($mysqli);} else { while($row = mysqli_fetch_array($dbc)){ $tag[] = $row['tag']; }}\[/code\]
 
Back
Top