I'm not a " real" developer and couldn't figure out how to create a frontend (for instance when for you'd like to use AppGini for a CMS).
Because I eventually was able to create one I would like to share it with you.
Please note:
- There must be a better way for connecting to the database,
- I have no idea if this is a "safe and secure" way of creating one (my page, a narrowcasting page for a school, is behind a .htaccess password),
- It would be great when AppGini would come with a "frontend" creator
Here it is:
Code: Select all
<?php
// The code is split into parts so it's easier to insert in a HTML file
// Connect to the database
$con=mysqli_connect("localhost","dbUSER","dbPASSWORD","dbNAME");
if (mysqli_connect_errno())
{
echo "Cannot connect to the database" . mysqli_connect_error();
}
?>
<?php
// Query the database and lookup the data from a table
$what = mysqli_query($con,"SELECT * FROM tableNAME");
while($row = mysqli_fetch_array($what))
{
// In this example a list is created of a table field named
echo "<li>" . $row['fieldNAME1'] ."</li>" ;
;}
?>
<?php
// Close the database connection
mysqli_close($con);
?>
Regards,
Dennis
P.s. If there's software that can be used to easily create a frontend, please let me know.