Ho fatto qualche modifica adesso riporto true per le varie funzioni, ho tollto l'eval però non sono sicurissimo che il while fatto così fosse quello che intendevi... copio il codice:
<?php
class mysql{
private $user = 'username';
private $password = 'password';
private $host = 'localhost';
public function open(){
$this->connessione = @mysql_connect($this->host,$this->user,$this->password);
$this->customError = "ERRORE: Non è possibile collegarsi al database per il seguente motivo: ". mysql_error()."";
if($this->connessione){return true;}else{echo $this->customError;}
}
public function close(){
$this->closeConnection = mysql_close($this->connessione);
return true;
}
public function db($database){
$this->database = $database;
$this->selectDB = mysql_select_db($this->database, $this->connessione);
return true;
}
public function select($tabella){
$this->tabella = $tabella;
$this->result = mysql_query("SELECT * FROM ".$this->tabella);
while($this->elementi = mysql_fetch_array($this->result)){
$this->titolo = $this->elementi['titolo'];
$this->testo = $this->elementi['testo'];
echo "INIZIO CICLO WHILE
";
echo $this->titolo."
";
echo $this->testo."
";
echo "FINE CICLO WHILE
";
}
return true;
}
}
?>
:master:

Rispondi quotando