本文整理匯總了PHP中storage::create_table方法的典型用法代碼示例。如果您正苦於以下問題:PHP storage::create_table方法的具體用法?PHP storage::create_table怎麽用?PHP storage::create_table使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類storage
的用法示例。
在下文中一共展示了storage::create_table方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
foreach (explode(',', $val) as $s) {
if (isset($datas[$s])) {
$days = isset($_GET['last']) ? $_GET['last'] : 1000;
$last_tms = time() - $days * 24 * 60 * 60;
$storage = new storage($s);
$storage->conn->query("delete from {$s} where tms > {$last_tms}");
echo "Erased all articles from {$s}<br><br>\n\n";
}
}
};
$cmd['t'] = "Create table.";
$func['t'] = function ($val) use($datas) {
foreach (explode(',', $val) as $s) {
if (isset($datas[$s])) {
$storage = new storage($s);
$storage->create_table();
echo "Created table {$s}<br><br>\n\n";
}
}
};
$cmd['r'] = "Read articles.";
$func['r'] = function ($val) use($datas) {
foreach (explode(',', $val) as $name) {
if (isset($datas[$name])) {
$storage = new Storage($name);
if (!isset($_GET['link'])) {
echo "<div style='margin:auto;width:700px;'><h1>" . $datas[$name]()->title . "</h1>";
$days = isset($_GET['days']) ? $_GET['days'] : 2;
foreach ($storage->last_articles($days) as $art) {
echo "<a href='retrieve.php?r={$name}&link=" . urlencode($art->link) . "'>{$art->title}, by {$art->author}</a><br>";
}