Originariamente inviato da simo22
Penso sia dovuto al fatto che sovrascrivi il costrutto. Devi usare una classe simile all'inserimento, ovvero che non sovrascrive __construct ed esegua la query dentro la funzione SelectCommenti.


Ho corretto in questo modo:
Codice PHP:
class select extends insert{
            
            public function 
SelectCommentiQuery(){
                if(isset(
$this->conn)){
                    
                
$query="SELECT*FROM commenti WHERE post='{$this->post}'";
                
                }else{
                    die(
'Errore nella selezione della query '.mysql_error());
                }
            }
            public function 
SelectCommentiResult(){
                if(isset(
$this->conn)){
                
$result=mysql_query($this->SelectCommentiQuery(), $this->conn) or die ("Errore: ".mysql_error());
            }else{
                die(
'Errore di result '.mysql_error());
            }
            }
        } 
Poi nel file commenti_pubblicati.php ho fatto così:
Codice PHP:
<?php
$select 
= new select();
$select->SelectCommentiQuery();

$result = new select();
$result->SelectCommentiResult();

echo(
'
<table width=700px;>
'
);
while(
$assoc=mysql_fetch_assoc($result->SelectCommentiResult()))
{
    echo(
'
    <tr><td>di '
.$assoc['utente'].'</td><td>il '.$assoc['data'].'</td></tr>
    <tr><td colspan="2">'
.$assoc['testo'].'</td></tr>
'
);
}

echo(
'
</table>
'
);

?>
Ora mi dice "Errore: Query was empty".