I have a db_connect.php which holds all information for the database. I now want to check if database exists and if not, create it.
Then i want to check if the used table exists, and if not, create it. Anyone have an idea how I exactly do this?
Here is my db_connect.php:
<?php
//outsourced db-informations
$db_host = 'localhost';
$db_user = 'root';
$db_passwort = '';
$db_name = 'test_db';
$db_table = 'data';
$db_mysqli = mysqli_connect("$db_host","$db_user","$db_passwort", "$db_name");
mysqli_connect("$db_host","$db_user","$db_passwort", "$db_name") or die
("Keine Verbindung moeglich");
?>