347
edits
Changes
no edit summary
<pre><?php$con = mysqli_connect("computerlocalhost", "usergbs788db", "passwordpw", "databasegbs788db"); //This references the database. We store it as a variable only so that we don't have to keep writing it out.
if(mysqli_connect_errno())
{
/*If we made it this far, it means that we successfully connected and made it to the next line. By putting echo, we are including html now!!*/
echo '
';
$sql = "SELECT * FROM `tabletest2`;";
$result = mysqli_query($con, $sql); //This does what we have been doing in SQL: connecting to the database, and then putting in the query.
while ($row=mysqli_fetch_array($result))//This command just looks at a table row by row.
{
echo '
'; /*This closes out the echo*/
}
echo '
';
?></pre>