Jump to content

SQL query producing random result...


DaveLinger

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!
Link to comment
https://forums.phpfreaks.com/topic/16603-sql-query-producing-random-result/
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.