本文整理汇总了PHP中Tweet::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Tweet::update方法的具体用法?PHP Tweet::update怎么用?PHP Tweet::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tweet
的用法示例。
在下文中一共展示了Tweet::update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: connectToEncryptedMySQL
<?php
require_once "/etc/apache2/capstone-mysql/encrypted-config.php";
$pdo = connectToEncryptedMySQL("/etc/apache2/data-design/dmartinez337.ini");
$tweet = new Tweet(null, 1, "this is from PHP");
$tweet->insert($pdo);
$tweet->setTweetContent("now I changed the message");
$tweet->update($pdo);
$tweet->delete($pdo);
示例2: testDeleteInvalidTweet
/**
* test deleting a Tweet that does not exist
*
* @expectedException PDOException
**/
public function testDeleteInvalidTweet()
{
// create a Tweet and try to delete it without actually inserting it
$tweet = new Tweet(null, $this->profile->getProfileId(), $this->VALID_TWEETCONTENT, $this->VALID_TWEETDATE);
$tweet->update($this->getPDO());
}
示例3: Tweet
$applications = DBObject::glob('Application', 'SELECT * FROM shine_applications ORDER BY name');
if (isset($_GET['refresh'])) {
include 'tweet-cron.php';
}
if (isset($_GET['delete'])) {
$t = new Tweet($_GET['delete']);
$t->deleted = 1;
$t->new = 0;
$t->update();
}
if (isset($_GET['reply'])) {
$t = new Tweet($_GET['reply']);
$t->replied_to = 1;
$t->reply_date = dater();
$t->new = 0;
$t->update();
redirect("http://twitter.com/home?status=@{$t->username}%20&in_reply_to={$t->tweet_id}");
}
$sql = '';
$app_id = '';
$group = '';
if (isset($_GET['id']) && !empty($_GET['id'])) {
$sql = 'AND app_id = ' . intval($_GET['id']);
$app_id = intval($_GET['id']);
} else {
$group = ' GROUP BY tweet_id ';
}
if (isset($_GET['read'])) {
$db = Database::getDatabase();
$db->query("UPDATE shine_tweets SET new = 0 WHERE 1 = 1 {$sql}");
redirect("tweets.php?id={$app_id}");