Boxerman Posted July 26, 2008 Share Posted July 26, 2008 Can any of you help me fix this? No matter what when I am reading any article it will set the title to the latest article rather than the article in question. Here is my code: while($rows=mysql_fetch_array($sql_result1)) { if (isset($_GET['id']) == false) { $news_title = "Index"; } else if (isset($_GET['id']) == $rows['id']) { $news_title = $rows['title']; } } <title>Ali Razaqpur - News - ', $news_title, '</title> Quote Link to comment https://forums.phpfreaks.com/topic/116758-title-help-quick-help/ Share on other sites More sharing options...
.josh Posted July 26, 2008 Share Posted July 26, 2008 would help if you showed your query string... Quote Link to comment https://forums.phpfreaks.com/topic/116758-title-help-quick-help/#findComment-600456 Share on other sites More sharing options...
Boxerman Posted July 26, 2008 Author Share Posted July 26, 2008 $sql_query = "SELECT * FROM news_main ORDER BY cat, title DESC"; $sql_result1 = mysql_query($sql_query); Quote Link to comment https://forums.phpfreaks.com/topic/116758-title-help-quick-help/#findComment-600463 Share on other sites More sharing options...
MattDunbar Posted July 26, 2008 Share Posted July 26, 2008 Your going to want to search WHERE newsitem=newsitemID or similar Quote Link to comment https://forums.phpfreaks.com/topic/116758-title-help-quick-help/#findComment-600467 Share on other sites More sharing options...
Boxerman Posted July 26, 2008 Author Share Posted July 26, 2008 Whats that then? something like "SELECT * FROM news_main ORDER BY cat, title DESC WHERE newsitem=newsitemID"; ?? Quote Link to comment https://forums.phpfreaks.com/topic/116758-title-help-quick-help/#findComment-600469 Share on other sites More sharing options...
.josh Posted July 26, 2008 Share Posted July 26, 2008 "SELECT * FROM news_main WHERE newsitem=newsitemID ORDER BY cat, title DESC "; Quote Link to comment https://forums.phpfreaks.com/topic/116758-title-help-quick-help/#findComment-600472 Share on other sites More sharing options...
Boxerman Posted July 26, 2008 Author Share Posted July 26, 2008 newsitem and newsitemID are what? Quote Link to comment https://forums.phpfreaks.com/topic/116758-title-help-quick-help/#findComment-600487 Share on other sites More sharing options...
.josh Posted July 26, 2008 Share Posted July 26, 2008 well i don't know. those are your cols/vars from your post. I just changed your query string around to the right order. Quote Link to comment https://forums.phpfreaks.com/topic/116758-title-help-quick-help/#findComment-600489 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.