Ah già:
Codice PHP:
<?php
class myUser {
private static $ID;
public function getID($id) {
self::$ID = $id;
}
public function getFilesList() {
$query = "SELECT * FROM myfiles WHERE ID_user='".self::$ID."'";
$result = @mysql_query($query);
while ($array = mysql_fetch_array($result)) {
echo $array[2];
}
}
}
myUser::getID('1');
myUser::getFilesList();
?>
Oppure:
Codice PHP:
<?php
class myUser {
private $ID;
public function getID($id) {
$this->ID = $id;
}
public function getFilesList() {
$query = "SELECT * FROM myfiles WHERE ID_user='".$this->ID."'";
$result = @mysql_query($query);
while ($array = mysql_fetch_array($result)) {
echo $array[2];
}
}
}
$user=new myUser;
$user->getID('1');
$user->getFilesList();
?>
Ciao!