0

Can I have ajax with PHP to get notification or alert when user submits form or data into mysql database?

In real time on server, it is obviously not recommended to refresh page/database every second. So, it is highly appreciated if someone helps me write an ajax/php code to get notification or alert when there is a new row added in mysql.

1 Answer 1

1

You should create a Javascript function that fetch data from your php script or Database and then return them back to user asynchronously without refreshing the page.

You would need to use ajax for refreshing a particular element of the page.

Please have a look here for more details.

Sign up to request clarification or add additional context in comments.

1 Comment

Apologies, can you write one simple example for me. To get notification when there are new data in mysql. Thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.