The school server created a table on the DBMS and printed it on the web using echo and mysqli functions so that the table can be viewed on the web with php.
// Enter code here
<?php
require 'vars.php';
$con = mysqli_connect ($servername, $username, $password);
if(mysqli_connect_errno()) {
echo "Failed to connect to MySQL : ".mysqli_connect_error();
}
mysqli_set_charset($con, "utf8");
if (!mysqli_select_db ($con, "kbstar21_db")) {
echo "Something wrong with database selection".mysqli_error();
} } else {
echo "Database selected successfully <BR><BR>";
}
$sql = "SELECT * FROM chicken";
echo ("<table width = 800 border = 1 cellpadding = 10>");
if ($result = mysqli_query($con, $sql)) {
$a = mysqli_num_fields ($result);
echo ("<tr>");
while ($fieldinfo = mysqli_fetch_field($result)) {
echo("<th>$fieldinfo->name</th>");
}
echo ("</tr>");
while ($row = mysqli_fetch_row($result)) {
while ($row = mysqli_fetch_row($result)) {
echo("<tr>");
for ($i = 0 ; $i < $a ; $i++) {
echo ("<td>$row[$i]</td>");
}
echo "</tr>";
}
}
mysqli_free_result ($result);
mysqli_close ($con);
?>
If you look at the php door on the web,
Add a column for the website address
echo "
<a href=site address>Chickenhouse name column name</a>
";
Why don't you try it?
925 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
574 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
577 Who developed the "avformat-59.dll" that comes with FFmpeg?
618 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.