本文整理匯總了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;
}