Verfasst: 09.04.2003 18:31
achja ganz vergessen: zeig die rate_viewtopic.php trotzdem da ich sonst nicht weiß welche funktion dazu benutzt wird...
ah
phpBB.de - Die deutsche phpBB-Community
https://www.phpbb.de/community/
Code: Alles auswählen
function rating_stats($topic_id)
{
//Returns 1D array of average, minimum, maximum, number_of_rates for $topic_id
global $db;
$sql = "SELECT AVG(rating) AS average,
MIN(rating) AS minimum,
MAX(rating) AS maximum,
COUNT(rating) AS number_of_rates
FROM " . RATE_TABLE .
" WHERE topic_id = " . $topic_id;
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't SELECT rating data.", "", __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
return $row;
}
Code: Alles auswählen
function rating_stats($topic_id)
{
//Returns 1D array of average, minimum, maximum, number_of_rates for $topic_id
global $db;
$sql = "SELECT AVG(rating) AS average,
MIN(rating) AS minimum,
MAX(rating) AS maximum,
COUNT(rating) AS number_of_rates
FROM " . RATE_TABLE .
" WHERE topic_id = " . $topic_id;
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't SELECT rating data.", "", __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$row['average'] = str_replace(',', '.', $row['average']);
return $row;
}
Ja ich habe dasselbe prob bei HE siehe hier: klickJason hat geschrieben:BTW: Hat vieleicht noch jemand anderes das gleiche Problem bei Hosteurope?
Code: Alles auswählen
$row['average'] = str_replace(',', '.', $row['average']);
Code: Alles auswählen
$row['average'] = str_replace(',', '.', '' . $row['average']);
Code: Alles auswählen
var_dump($row['average']);