ciao,
ho un indice delle categorie delle faq.
avrei bisigno di aggiungere il numero, cioè quante faq sono presenti per ogni categoria.
Per cui ho 2 tabelle:
1 - categoria faq
2 - faq per categoria
adesso io ho questo:
codice:
$query = "SELECT * FROM cat_faq";
$result = mysql_query($query) or die(mysql_error());
echo "<table class=\"tabella\">";
if (mysql_num_rows($result) >0){
/* determine number of rows result set */
$row_cnt = mysql_num_rows($result);
while($select = mysql_fetch_array($result)){
echo"<tr><td><a href=\"index.php?page=pagina\">{$select["nome_cat_faq"]}";
printf($row_cnt);
echo"</a></td></tr>";
allora, la query così com'è non va..devo usare LEFT JOIN?
ho provato una cosa del genere...
codice:
$query = "SELECT * FROM cat_faq c LEFT JOIN prod_faq p ON c.id_cat_faq = p.id_prod_faq ORDER BY c.id_cat_faq, p.id_prod_faq";
ma non mi restituisce niente...
che pastrocchio ho fatto??