DaveLinger Posted August 5, 2006 Share Posted August 5, 2006 [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 More sharing options...
kenrbnsn Posted August 5, 2006 Share Posted August 5, 2006 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 Link to comment https://forums.phpfreaks.com/topic/16603-sql-query-producing-random-result/#findComment-69546 Share on other sites More sharing options...
ryanlwh Posted August 5, 2006 Share Posted August 5, 2006 i think you have something in header2.php that overrid $title Link to comment https://forums.phpfreaks.com/topic/16603-sql-query-producing-random-result/#findComment-69599 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.