To display or fetch data from the MYSQL database table then you have to create a database and a table. Insert some data into the table.
CREATE TABLE `persons` ( `id` int(50) NOT NULL, `fname` varchar(40) NOT NULL, `lname` varchar(30) NOT NULL, `email` varchar(50) NOT NULL, `address` varchar(50) NOT NULL, `mobile` varchar(50) NOT NULL, `password` varchar(40) NOT NULL, `acno` varchar(40) NOT NULL, `bank_name` varchar(30) NOT NULL, `owner_name` varchar(30) NOT NULL, `ac_type` varchar(30) NOT NULL, `ifsc` varchar(50) NOT NULL, `name` blob NOT NULL, `date` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
We created a table for fetch data via PHP and Ajax. We have taken some table fields
You want to display the data from the database then you need to insert some data in the table. Insert some data in the table and fetch through PHP and Ajax.
INSERT INTO `persons` (`id`, `fname`, `lname`, `email`, `address`, `mobile`, `password`, `acno`, `bank_name`, `owner_name`, `ac_type`, `ifsc`,`date`) VALUES (81, 'Mohan', 'Rana', 'email@example.com', 'Shamli', '7812828887', 'admin@123', '739837927193', 'SBI', 'Mohan Rana', 'Saving ', 'SBI00875464', '2019-09-18');
In the above insertion, you can insert all data and fetch via ajax and display it on the webpage.
When we work on MYSQL database ,we need a connection between MYSQL database and PHP script. The data is displayed through the PHP and AJAX on the page after database connectivity. Let's create a config file.
User Image Full Name Mobile Address Payment Details