语法错误,意外'$ alert'(T_VARIABLE)

hmm i d'ont understand why I have this error:

Parse error: syntax error, unexpected '$alert' (T_VARIABLE) in C:\wamp\www\envMailAuto\controler.php on line 19

my controler:

include 'modele.php';

$email=$_REQUEST["email2"];
if(isset($_REQUEST["check"])) echo $email;
else echo "omged";
$idarticle = 3555;

$DB_host     = "localhost";
   $DB_select   = "envmail";
   $DB_login    = "root";
   $DB_pass     = '';

$connection=mysql_connect($DB_host,$DB_login,$DB_pass); 

$db=mysql_select_db($DB_select, $conn);


alertarticleDAO $alert = new __alertarticle($connection);

my model:

Class alertarticleDAO {

var $connection;

public function __alertarticle($mysqlconnection){
$this->connection = $mysqlconnection;
}

public function insert($Idarticle,$email){
$query=" INSERT INTO envmail ( mail_env , id_article , actif )
VALUES ( $Idarticle , $email , 1)";

mysql_query($query,$this->connection);

}


}

In PHP you don't need to specify the type when you initialize an object. Change this line:

alertarticleDAO $alert = new __alertarticle($connection);

into this:

$alert = new alertarticle($connection);

and the constructor definition is also wrong, change this:

public function __alertarticle($mysqlconnection){

into this:

function __construct($mysqlconnection){

Just remove the invalid keyword alertarticleDAO. In PHP you don't "set" the type of the variable like that.

But your "constructor" is not quite right, either you name it exactly like the class name or you name it __construct().

So, your Constructor should look like this:

function __construct($mysqlconnection) { ... }

Instanciate it:

$alert = new alertarticleDAO($connection);