Insert form data into database using php-mysqli

It is very easy to insert data into database using php and i will you mysqli. I have used post method for data insertion. It is upto you & you can use post or get method for form handling .

Your database table will look like this :- Only two coulmn needed user_name & user_comment .

user_name user_comment
maheshI am mahesh a web developer

Output of above code : Demo Form

Write your name & post your comment :

If you hit comment button then it will show you this message

” Your data inserted into database successfully “

Now i am giving you second form example in which first i will add data into database then i will fetch it from database

Output of code :

Write your name & post your comment :

Now if you add some data in this form and hit Comment button then it will show all data from database

Leave a Reply

Your email address will not be published. Required fields are marked *