Source : lesson_15_e_alter_table.php |
Résultat |
<?php require ("../mysql_connexion/mysql_connexion.php"); //mysql_select_db($db) ; $result = mysqli_query($mysqli,"alter table atelierphp_sol_titres drop column nb_pages"); if ($result == 1) { echo "column Nb_PAGES dropped <br/>"; } else { echo "error droping column nb_pages<br/>"; } $result = mysqli_query($mysqli,"alter table atelierphp_sol_titres add column nb_pages int NOT NULL "); if ($result == 1) { echo "Nb_PAGES added to columns <br/>"; } else { echo "error inserting nb_pages column<br/>"; } $result = mysqli_query($mysqli,"alter table atelierphp_sol_titres add index (nb_pages) "); if ($result == 1) { echo "index added to Nb_PAGES <br/>"; } else { echo "error inserting index to nb_pages <br/>"; } ?>
|
error droping column nb_pages Nb_PAGES added to columns index added to Nb_PAGES
|