Ejemplo n.º 1
0
 public static function register($user, $pass, $email)
 {
     $query = "insert into account(username,password,email) values('{$user}','{$pass}','{$email}')";
     Mdb::nonSelectQuery($query);
     $query = "insert into profile(status) values('active')";
     Mdb::nonSelectQuery($query);
 }
Ejemplo n.º 2
0
 public static function delete($id)
 {
     $query = "delete from expression where id={$id}";
     Mdb::nonSelectQuery($query);
 }
Ejemplo n.º 3
0
 public static function setPassword($user, $pass)
 {
     $query = "update account set password='******' where username='******'";
     Mdb::nonSelectQuery($query);
 }
Ejemplo n.º 4
0
 public static function updateExpression($id, $name, $desc, $content)
 {
     $query = "update expression set name='{$name}',description='{$desc}',content='{$content}' where id={$id}";
     Mdb::nonSelectQuery($query);
 }
Ejemplo n.º 5
0
 public static function save($accid, $fid, $type)
 {
     if ($type == "DODAJ U KOLEKCIJU") {
         $query = "insert into pinned(accid,fid) values({$accid},{$fid})";
         Mdb::nonSelectQuery($query);
         $query = "update expression set popularity=popularity+1 where id={$fid}";
         Mdb::nonSelectQuery($query);
     } else {
         if ($type == "BRIŠI IZ KOLEKCIJE") {
             $query = "delete from pinned where accid={$accid} and fid={$fid}";
             Mdb::nonSelectQuery($query);
             $query = "update expression set popularity=popularity-1 where id={$fid}";
             Mdb::nonSelectQuery($query);
         }
     }
 }