Created
September 14, 2018 06:58
-
-
Save domosedov/cd22b33dd9136881c3092e2e4cfa4326 to your computer and use it in GitHub Desktop.
фрагмент кода, позволяющий проверить в браузере факт успешного создания таблицы
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'login.php'; | |
$conn = new mysqli($hn, $un, $pw, $db); | |
if ($conn->connect_error) die($conn->connect_error); | |
$query = "DESCRIBE <Имя таблиц>"; | |
$result = $conn->query($query); | |
if (!$result) die ("Database access failed: " . $conn->error); | |
$rows = $result->num_rows; | |
echo "<table><tr><th>Column</th><th>Type</th><th>Null</th><th>Key</th></tr>"; | |
for ($j = 0 ; $j < $rows ; ++$j) | |
{ | |
$result->data_seek($j); | |
$row = $result->fetch_array(MYSQLI_NUM); | |
echo "<tr>"; | |
for ($k = 0 ; $k < 4 ; ++$k) echo "<td>$row[$k]</td>"; | |
echo "</tr>"; | |
} | |
echo "</table>"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment