本文整理汇总了PHP中dbconnection::doQueryObject方法的典型用法代码示例。如果您正苦于以下问题:PHP dbconnection::doQueryObject方法的具体用法?PHP dbconnection::doQueryObject怎么用?PHP dbconnection::doQueryObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dbconnection
的用法示例。
在下文中一共展示了dbconnection::doQueryObject方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTweetsPostedBy
public static function getTweetsPostedBy($idUser)
{
$connection = new dbconnection();
$sql = "select * from jabaianb.tweet where emetteur='" . $idUser . "'";
$res = $connection->doQueryObject($sql, "tweet");
return $res === false ? false : $res;
}
示例2: getUsers
public static function getUsers()
{
$connection = new dbconnection();
$sql = "select * from jabaianb.utilisateur";
$res = $connection->doQueryObject($sql, "utilisateurTable");
return $res === false ? false : $res;
}
示例3: getPostbyId
public static function getPostbyId($id)
{
$connection = new dbconnection();
$sql = "select * from jabaianb.post where id='" . $id . "'";
$res = $connection->doQueryObject($sql, "post");
return $res === false ? false : $res;
}
示例4: getUsersWhoLikeTweetById
public static function getUsersWhoLikeTweetById($tweetId)
{
$connection = new dbconnection();
$sql = "SELECT U.* FROM jabaianb.utilisateur U\r\n\t\t\t\t\tINNER JOIN jabaianb.vote V ON (U.id = V.utilisateur)\r\n\t\t\t\tWHERE V.message = " . $tweetId;
$res = $connection->doQueryObject($sql, "utilisateur");
if ($res === false) {
return null;
}
return $res;
}
示例5: getVoteByTweetAndUser
public static function getVoteByTweetAndUser($tweetId, $userId)
{
$connection = new dbconnection();
$sql = "SELECT * FROM jabaianb.vote WHERE message = " . $tweetId . " AND utilisateur = " . $userId;
$res = $connection->doQueryObject($sql, "vote");
if ($res === false || empty($res)) {
return null;
}
return $res[0];
}
示例6: getLastTweets
public static function getLastTweets($max = 10, $daysDifference = 30)
{
$dateLimite = strtotime(date("Y-m-d H:i:s") . "-" . $daysDifference . " day");
$dateLimite = date("Y-m-d H:i:s", $dateLimite);
$connection = new dbconnection();
$sql = "SELECT T.* FROM jabaianb.tweet T\n\t\t INNER JOIN jabaianb.post P ON (T.post = P.id)\n\t\t WHERE P.date >= '" . $dateLimite . "'\n\t\t ORDER BY T.id DESC\n\t\t LIMIT " . $max;
$res = $connection->doQueryObject($sql, "tweet");
if ($res === false) {
return null;
}
return $res;
}