Idea programu jest prosta i dotyczy sprawdzenia czy w bazie MYSQL istnieje już tabela o nazwie podanej w formularzu jeżeli tak to pokaż liczbę tych tabel (niemożliwe jest aby były co najmniej 2 takie same ale ....)
check_error_index.php
<!DOCTYPE html> <HTML lang="pl"> <head> <meta charset= "UTF-8" /> <title>Form</title> </head> <body> <form action= "check_error.php" method= "post"> <input type="text" name="name"> <input type="submit" value="send"> </form> </body> </HTML>
check_error.php
<?php ?> <?php $link = mysqli_connect("localhost", "root", "", "pomiar"); $name = $_POST['name']; $_SESSION['name'] = $name; $status = true; if ($link != $status) { $status = false; }else{ } if($link == true){ $result = mysqli_query($link, "SHOW TABLES LIKE '$_SESSION[name]'"); $_SESSION['row_cnt'] = mysqli_num_rows($result); }else{ } ?>
check_error1.php
<?php ?> <?php ?>