Source : lesson_09_a3_create_table_loans.php |
Résultat |
<?php require ("../mysql_connexion/mysql_connexion.php"); require ("../commons/functions.php"); //mysql_select_db($db) ; /*Table des emprunts +-----------+----------+ | membre_id | video_id | +-----------+----------+ | 2 | 6 | | 4 | 2 | | 1 | 1 | | 1 | 2 | | 1 | 3 | +-----------+----------+*/ $tableName = "atelierphp_sol_emprunts"; (mySQLtable_exist($tableName)) ? drop_table($tableName) : print (""); //---------------------------------------------------------------- $result = mysqli_query($mysqli,"CREATE TABLE $tableName (emprunt_video_id INT NOT NULL, emprunt_membre_id INT, emprunt_date TIMESTAMP, PRIMARY KEY (emprunt_video_id) , INDEX (emprunt_video_id))") ; ($result == 1)? print("Table $tableName created<br/>") : print("Error creating the table $tableName<br/>"); // emprunt_date TIMESTAMP, ?>
|
La table existait déjà Efface table atelierphp_sol_emprunts Table effacée Table atelierphp_sol_emprunts created
|