只需要修改数据库的信息。
- <html>
- <head>
- <title>View Database</title>
- <body>
- <?php
- //connect database
- $db_host = 'localhost';
- $db_user = 'username';
- $db_pwd = 'password';
- $database = 'database';
- $table = 'table';
- // sending query
- if (!$result)
- {
- }
- echo "<h1>Table: {$table}</h1>";
- echo "<table border='1'><tr>";
- // printing table headers
- for($i=0; $i<$fields_num; $i++)
- {
- echo "<td>{$field->name}</td>";
- }
- {
- // $row is array... foreach( .. ) puts every element
- // of $row to $cell variable
- foreach($row as $cell)
- echo "</tr>\n";
- }
- echo"<p><a href=test.php>Back Home</a></p>";
- ?>
- </body>
- </html>
Comments