本文整理匯總了PHP中Banner::insert方法的典型用法代碼示例。如果您正苦於以下問題:PHP Banner::insert方法的具體用法?PHP Banner::insert怎麽用?PHP Banner::insert使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Banner
的用法示例。
在下文中一共展示了Banner::insert方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: count
/**
* 保存子表信息
* @access public
*/
function save_image($banner_id)
{
//保存子表
echo $banner_id;
$filename = get_post_value('filename');
$fileurl = get_post_value('fileurl');
$fileSubtitle = get_post_value('fileSubtitle');
$filePrice = get_post_value('filePrice');
$num = count($filename);
print_r($filename);
//$filename.$fileurl.$fileSubtitle.$filePrice;
//print_r($fileurl);
$m = new Banner();
if ($filename != '' && count($filename) > 0) {
$order = 0;
for ($i = 0; $i < $num; $i++) {
$field = array('image_path' => '/Upload/' . $filename[$i], 'orders' => $order, 'status' => '10000', 'created' => date('Y-m-d H:i:s', time()));
$m->clear();
$m->setTable('vcb_index_banner1');
$m->setField($field);
$data = $m->insert();
$order++;
}
}
}
示例2: Banner
/**
* 保存子表信息
* @access public
*/
function save_image($category_id)
{
//保存子表
$filename = get_post_value('filename');
$m = new Banner();
if ($filename != '' && count($filename) > 0) {
$order = 0;
foreach ($filename as $file) {
$field = array('category_id' => $category_id, 'image_path' => $file, 'orders' => $order, 'status' => '10000', 'created' => date('Y-m-d H:i:s', time()));
$m->clear();
$m->setTable('vcb_banner_images');
$m->setField($field);
$data = $m->insert();
$order++;
}
}
}