How to insert database rows if there are no answers

Simply do not insert anything into Answer table when there is no answer. Rest of your solution is basically correct.

When displaying questions with answer, check if there is answer (empty select result or null in left joined column) to show and if not, show “No answer”. But there is no “No answer” in database.

Leave a Comment