I wasn't able to output the value of $id,
My first code was:
class add_User
{
public function User($id) { //<-- in //
$statement = "INSERT INTO `users` " . $this->$id. "varchar(255)"; // just nothing
print($statement); //<-- out //
}
public function Moderator($id) {
$statement = "INSERT INTO `users` " . $this->$id . "varchar(255)"; // just nothing
print($statement);
}
}
$check_statement = new add_User();
$check_statement->User('user1');
$check_statement->Moderator('mod1');
My current code works fine with just $this->$id, $id