questo quello che ti serve
codice:$sql = " SELECT count(app_event.id) AS totaleid FROM app_event JOIN app_event_book ON app_event_book.event_id = app_event.id WHERE app_event.category_id='21'"; $row = mysqli_fetch_array($conn1->query($sql),MYSQLI_ASSOC); echo $row['totaleid'];