Jump to content

PHP Help - query is showing null


Padgoi

Recommended Posts

Hi everyone,

So I have this code and the first part of it works fine, but the $q part of it is just displaying null.  Can anyone help me with this:

 

function eatbox()
{

$pop = mysql_query( "select starter_name, count(*) as replies from ibf_posts join ibf_topics on tid=topic_id where new_topic=0 group by starter_name order by replies desc LIMIT 25" )
or die("SELECT Error: ".mysql_error());
$num_rows = mysql_num_rows($pop);
$this->output .= "<table border=1>\n";
while ($get_info = mysql_fetch_row($pop)){
$this->output .= "<tr>\n";
foreach ($get_info as $field)
{$this->output .= "\t<td><font face=arial size=1/>$field</font></td>\n";}
$q = "select count(*) as topics from ibf_topics where starter_name = '".$get_info['starter_name']."'";
$poop = mysql_query( $q) or die("SELECT Error: ".mysql_error());
$get_topics = mysql_fetch_row($poop));
$this->output .= "\t<td><font face=arial size=1/>$get_topics['topics']</font></td>\n";
$this->output .= "</tr>\n";


}

Link to comment
https://forums.phpfreaks.com/topic/159164-php-help-query-is-showing-null/
Share on other sites

I hope you have one topic_id column or that's going to be an ambiguous column in your JOIN statement. Is that doing what you want it to do?

 

Yeah, that is working fine, the first part of the query works fine, it's the second part, the $q and $poop parts that are displaying null.  Please help?

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.