Exemple #1
0
 function insert()
 {
     $query = "INSERT INTO  `members` (\n`id` ,\n`username` ,\n`password` ,\n`email` ,\n`created_on` ,\n`is_admin` ,\n`firstname` ,\n`lastname` ,\n`gender` ,\n`address`,\n`is_doctor`\n)\nVALUES (\nNULL ,  '" . $this->getUsername() . "',\n  '" . md5($this->getPassword()) . "',\n    '" . $this->getEmail() . "', NOW( ) ,  '0', \n     '" . $this->getFirstname() . "',  \n     '" . $this->getLastname() . "',  \n     '" . $this->getGender() . "',  \n     '" . $this->getAddress() . "',\n     '" . $this->getIsDoctor() . "'\n)\n";
     $result = $this->db->query($query);
     // echo $result->err
     self::$message = "Registered SuccessFully";
     if ($this->getIsDoctor() == 1) {
         $query = "INSERT INTO `doctor_info` VALUES(NULL,'" . $this->getFirstname() . " " . $this->getLastname() . "','0','0')";
         $this->db->query($query);
     }
     return $this->db->affected_rows;
 }