How to select 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");
// We want to get the whole table content
// For this we use a SELECT:
# The following Function gives us a two dimensional array [See tutorial: https://www.w3schools.com/php/php_arrays_multi.asp]
$resultFromQueryAsArray = $msql->executeSelect("* FROM MyGuests", E_ReturnType::TWO_D_ARRAY);
# The following Function gives us the mysql table that get returned by the select query
# Tutorials here: https://www.w3schools.com/php/php_mysql_select.asp
$resultFromQueryAsTable = $msql->executeSelect("* FROM MyGuests", E_ReturnType::MYSQL_TABLE);
$msql->dispose("acc", "x");
?>