Aiuto piccolo script PHP
Inviato: 27/11/2008, 19:46
Ciao nel reviews.php sto facendo uno script che a secondo delle stelle che ci sono invia un messaggio. ma il problema è che non so quale sia la variabile che tiene conto del numero di stelle
ho provato cosi
<?php
$reviews_query_raw = "select r.reviews_id, rd.reviews_text, r.reviews_rating, r.date_added, p.products_id, pd.products_name, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_PRODUCTS_DESCRIPTION . " pd where c.categories_status=1 and p.products_id = p2c.products_id and c.categories_id = p2c.categories_id and p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and rd.languages_id = '" . (int)$languages_id . "' order by r.reviews_id DESC";
$reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);
if($reviews_split->number_of_rows>=1&&number_of_rows<=2)
echo "Pessimo";
else if($reviews_split->number_of_rows>=3)
echo "Neutro";
else if($reviews_split->number_of_rows>3)
echo "Ottimo";
?>
ma vedo solo "Pessimo"
consigli?
ho provato cosi
<?php
$reviews_query_raw = "select r.reviews_id, rd.reviews_text, r.reviews_rating, r.date_added, p.products_id, pd.products_name, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_PRODUCTS_DESCRIPTION . " pd where c.categories_status=1 and p.products_id = p2c.products_id and c.categories_id = p2c.categories_id and p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and rd.languages_id = '" . (int)$languages_id . "' order by r.reviews_id DESC";
$reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);
if($reviews_split->number_of_rows>=1&&number_of_rows<=2)
echo "Pessimo";
else if($reviews_split->number_of_rows>=3)
echo "Neutro";
else if($reviews_split->number_of_rows>3)
echo "Ottimo";
?>
ma vedo solo "Pessimo"
consigli?