The INSERT command is used to add data to MySQL:
INSERT INTO table_name (column1, column2, column3) VALUES ( value1, value2, value3)
Add data to the database OOP PHP example:
$conn = new mysqli("localhost", "root", "password", "testdb"); if($conn->connect_error){ die("Error: " . $conn->connect_error); } $sql = "INSERT INTO Users (name, surname, age) VALUES ('Stiven', 'Sigal' 57)"; if($conn->query($sql)){ echo "User added"; } else{ echo "User not added" . $conn->error; } $conn->close();
Create MySQL database on PHP. OOP example
May 4, 2022
Creating a table in a database. PHP OOP example
May 4, 2022
MySQL OOP PHP Connection. Code example
May 4, 2022