NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page echoing information from query - not working

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 05-19-2005, 09:13 AM THREAD STARTER               #1 (permalink)
The original NP Emo Kid
 
liam_d's Avatar
Join Date: Jan 2005
Location: Plymouth, UK
Posts: 1,693
liam_d is a name known to allliam_d is a name known to allliam_d is a name known to allliam_d is a name known to allliam_d is a name known to allliam_d is a name known to all
 




echoing information from query - not working


Hi all before i get started here is the background of what this script does; Basicly it checks the last post of a forum i made (http://www.emoforums.net/forum/) and what it does is check for the last post in the forum, if it has replies then select the last info from the replies table if not then use the previous query which takes it from the topics table the problem is that if there is no replies then the $last_info2 doesnt work.
????: NamePros.com http://www.namepros.com/programming/91417-echoing-information-from-query-not-working.html

PHP Code:
        // to find out if a the latest topic has a reply
        
$find_topic mysql_fetch_array(mysql_query("SELECT * FROM `forum_topics` WHERE `forumroot` = '" $display['id'] . "' ORDER BY `lastdate` DESC LIMIT 1"));
        
        
$find_replies mysql_fetch_array(mysql_query("SELECT COUNT(replies) AS `count` FROM `forum_topics` WHERE `forumroot` = '" $display['id'] . "' ORDER BY `lastdate` DESC LIMIT 1"));
        if (
$find_replies['count'] >= '1')
        {
            
$last_info mysql_fetch_array(mysql_query("SELECT * FROM `forum_replies` WHERE `topic_id` = '" $find_topic['id'] . "' ORDER BY `id` DESC LIMIT 1"));
            
$last_info2 mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '" $last_info['starter_id'] . "'"));
????: NamePros.com http://www.namepros.com/showthread.php?t=91417
            
$last_info['topic'] = $find_topic['topic'];
        }
        
        else
        {
            
$last_info $find_topic;
            
$last_info2 mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '" $last_info['starter_id'] . "'"));
        } 
liam_d is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
I call. Let's see your hand. Show Us Your Poker Domains! Grrilla Domain Name Discussion 210 01-03-2006 07:26 PM
fulltext mysql query not working! help! PoorDoggie Programming 11 05-10-2005 02:57 PM
Google Adsense jstep Google Adsense 9 07-30-2004 01:07 PM
WARNING: PayPal Fraud Emails NamePopper Warnings & Alerts 18 06-27-2003 08:01 PM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 11:08 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger