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> 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... 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); 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 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"; ?? 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 "; 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? 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. Link to comment https://forums.phpfreaks.com/topic/116758-title-help-quick-help/#findComment-600489 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.