hey guys!
I am trying to learn some basic php oop by mmtuts tutorials and have understood the basic when it comes to instantiating classes and selecting from the database… I can access my database now but I want to change emailactivation, which is set to 0 to 1… I am assuming that it should look something like this:
<?php
class emailactivation extends checktoken{
public function emailActivation(){
$datas = $this->getAllUsers();
foreach ($datas as $data) {
if($data['token'] == $data['tokencheck']){
$sql = "SELECT id FROM user WHERE token=$data['token'] AND tokencheck =$data['tokencheck'] AND emailactivation=$data['emailactivation']";
$result = $this->connect()->query($sql);
$numRows = $result->num_rows;
if($numRows >0 ){
$sql ="UPDATE user SET emailactivation =1 AND token=''";
}
}
}
}
}
But I got the following errors:
Parse error: syntax error, unexpected ‘’ (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C:\xampp\htdocs\mmtuts\includes\emailactivation.php on line 10