I'm trying to learn up PHP and HTML and I've gotten stuck.
I have a PHP PDO SQL query
$stmt = $conn->prepare("SELECT COUNT FROM tbl WHERE Staff ID='$staff_id';");
$stmt->execute();`
I would like to add this to a table cell containing a form submit, below:
<td>
<form action='staff_view_by_id.php?name="<?php echo $row['staff_id']; ?>"' method="post">
<input type="hidden" name="staff_id" value="<?php echo $row['staff_id'] ?>">
<input type="submit" id="staff_list_submit" name="submit" value="View">
</form>
I'd like to have something that would cause that View button to be disabled if the result of the SQL Count is zero.
Is there a way to do this? I'm guessing it would be an if statement of some kind, but so far I can't get it to work.
Thanks