Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
897 views
in Q2A Core by
Hello Pros,

How to save feedback messages to database ?

When visitors or users send feedback messages to admin, i want to save these feedback messages in database.

Here is my idea - create database table -  qa_feedbacks with columns.

1. Date

2 .Name

3. Email

4. Feedback

5. Username or NULL for visitor

6. Userid or NULL for visitor

It would be nice if i had a list of feedback messages saved in my database so i could download csv later to review it.

Thanks for your help.
Q2A version: 1.7.5

1 Answer

+2 votes
by

You can save whatever information you want. That's up to you. Once you have that you're only missing a listener for the form submission event. You can create that listener by creating a plugin that contains an event module that listens to the feedback event. Then just insert the records in the table whenever the event is generated.

by
@pupi1985,

Thank you for your reply. I have no idea how to create event listener plugin.

May be someone could create a query on feedback.php page itself to insert form input in database.
by
+2
No problem. You can learn about how to create plugins and events in the plugin reference ( https://docs.question2answer.org/plugins ) or even going through the plugin tutorial ( https://docs.question2answer.org/plugins/tutorial )
...