Jump to content

[SOLVED] help


ngreenwood6

Recommended Posts

Does anybody see anything wrong with this code? It is not displaying the results but I know the data exists in the database.

 

<?php
//include the variables
include("vars.php");

//get the type of tutorial
$type = $_GET['type'];

//connect to the database
$connect = mysql_connect($host, $db_user, $db_pass);

//select the database
$select = mysql_select_db($db);

//make the query
$query = "SELECT * FROM $db_table WHERE type='$type'";

$results = mysql_query($query);

//display the results
while($row = mysql_fetch_array($results));
{
$username = $row['username'];
$title = $row['title'];
$text = $row['text'];

echo "<table><tr><td>This was posted by $username</td></tr>";
echo "<tr><td><b>$title<b></td></tr>";
echo "<tr><td>$text</td></tr>";
}
?>

Link to comment
https://forums.phpfreaks.com/topic/131197-solved-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.