Here, we have created a "students" table in the database (myDB) with the following values:
CREATE TABLE students
(
id INT(4) UNSIGNED auto_increment PRIMARY KEY,
firstname VARCHAR(30) NOT NULL,
lastname VARCHAR(30) NOT NULL,
class INT(2)
);
INSERT INTO students (firstname, lastname, class) VALUES
-> ('sathish','kumar',12),
-> ('rakesh','singh',8),
-> ('sonam','gupta',11),
-> ('dilbar','pathak',6),
-> ('salim','khan',7),
-> ('kabir','singh',6),
-> ('arjun','reddy',6);
Here, is the data in the database table (students tables),
We use PHP PDO (PHP Data Objects) to interface with MySQL
PHP code to fetch data from database
need an explanation for this answer? contact us directly to get an explanation for this answer