How to insert data?
<?php
# Including MySQLm [See https://github.com/AtjonTV/MySQLm/wiki/1.-Getting-Started or https://atjontv.github.io/MySQLm/starting.html]
include 'https://raw.githubusercontent.com/AtjonTV/MySQLm/dev-1.5/src/MySQLm.php';
# Creating MySQLm Object with direct connect [ See https://github.com/AtjonTV/MySQLm/wiki/2-Connecting or https://atjontv.github.io/MySQLm/db-connecting.html]
$msql = new MySQLm("database-server.com", 3306, "myusername", "userspassword", "databasename", "charset");
/* For this showcase/tutorial/wiki, i will use the w3schools php&&sql tutorial
If you want to see the original you can visit:
https://www.w3schools.com/php/php_mysql_create_table.asp
This tutorial wont show the commands from the last tutorial,
i only change the database.
*/
// As seen in tutorial 4 [https://github.com/AtjonTV/MySQLm/wiki/4-Create or https://atjontv.github.io/MySQLm/db-creating.html] were we created a database,
// we now need to use it, and to do so we need to use an execute.
// As seen in tutorial 3 [https://github.com/AtjonTV/MySQLm/wiki/3-Chaning-Database or https://atjontv.github.io/MySQLm/db-changing.html] we will use executeUse
$msql->executeUse("ShowCaseDatabase");
// Now we need to insert into the table
// The easiest way is to use executeInsert
# To make it more overviewable, lets make a query variable:
$query = "INTO MyGuests (firstname, lastname, email)
VALUES ('John', 'Doe', 'john@example.com')";
# Now, execute the Insert (The Insert keyword gets automaticly set before the query we give)
$msql->executeInsert($query);
$msql->dispose("acc", "x");
?>