Пример #1
0
 public static function getLike($id)
 {
     $connection = new dbconnection();
     $sql = "select count(*) from jabaianb.vote where tweet='" . $id . "'";
     $res = $connection->doQuery($sql);
     return $res === false ? false : $res;
 }
 public static function getUserByLoginAndPass($login, $pass)
 {
     $connection = new dbconnection();
     $sql = "select id from jabaianb.utilisateur where identifiant='" . $login . "' and pass='******'";
     $res = $connection->doQuery($sql);
     return $res === false ? false : $res;
 }
Пример #3
0
 public static function getCountLastTweets($startDate)
 {
     $connection = new dbconnection();
     $sql = "SELECT COUNT(*) FROM jabaianb.tweet T\n\t\t            INNER JOIN jabaianb.post P ON (T.post = P.id)\n\t\t        WHERE P.date > '" . $startDate . "'";
     $res = $connection->doQuery($sql);
     if ($res === false) {
         return null;
     }
     return $res[0]["count"];
 }
Пример #4
0
 public static function getCountLikesById($tweetId)
 {
     $connection = new dbconnection();
     $sql = "SELECT COUNT(*) FROM jabaianb.vote WHERE message = " . $tweetId;
     $res = $connection->doQuery($sql);
     if ($res === false) {
         return 0;
     }
     return $res[0]["count"];
 }