Page 1 of 1

MYSQL query, is this possible?

Posted: Tue Jul 22, 2008 6:38 pm
by scrambleded
$rater = 'SELECT rating_sum FROM #__content_rating WHERE content_id=743';

in the table content_rating and on the content_id 743 the rating sum is 4

so why does

echo $rater; // propduce nothing???


I would greatly appreciate any help, thanks.

Re: MYSQL query, is this possible?

Posted: Tue Jul 22, 2008 6:56 pm
by WebbieDave

Re: MYSQL query, is this possible?

Posted: Tue Jul 22, 2008 6:58 pm
by califdon
scrambleded wrote:$rater = 'SELECT rating_sum FROM #__content_rating WHERE content_id=743';

in the table content_rating and on the content_id 743 the rating sum is 4

so why does

echo $rater; // propduce nothing???


I would greatly appreciate any help, thanks.
What is the purpose of the #_ ?

Re: MYSQL query, is this possible?

Posted: Tue Jul 22, 2008 7:10 pm
by Buddy
try these:

Code: Select all

 
 
$rater = 'SELECT rating_sum FROM #__content_rating WHERE content_id=743';
 
$result=mysql_query($rater);
 
while ($row = msql_fetch_array($result))
{
    $rs[]=$row['rating_sum'];
}
 
print_r($rs);