Jump to content

Archived

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

DaveLinger

SQL query producing random result...

Recommended Posts

[code]$query="SELECT *, DATE_FORMAT(time, '%W, %M %D') AS my_date FROM nuke_stories WHERE sid = $sid";
$result = mysql_query($query) or die("Problem with the query: $query<br>" . mysql_error());

mysql_close();

while ($row = mysql_fetch_assoc($result))
{
$sid = $row['sid'];
$aid = $row['aid'];
$title = $row['title'];
$hometext = $row['hometext'];
$my_date = $row['my_date'];

echo "<html><head><title>$title - $sitename</title><link href=\"http://www.gamefreaks365.com/css.css\" rel=\"stylesheet\" type=\"text/css\" /></head>";

include('includes/header2.php');

echo "$title";
$i++;
}[/code]

the FIRST time I echo $title it's correct. The second time it's a random result!

Share this post


Link to post
Share on other sites
What do you mean by "a random result"? What's in the file header2.php? What happens if you remove the "mysql_closer()" line, which you really don't need.

Ken

Share this post


Link to post
Share on other sites

×

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.