当前位置: 首页>>代码示例>>PHP>>正文


PHP category::insert方法代码示例

本文整理汇总了PHP中category::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP category::insert方法的具体用法?PHP category::insert怎么用?PHP category::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在category的用法示例。


在下文中一共展示了category::insert方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: category

<?php

include 'categoryclass.php';
if (isset($_POST['Add'])) {
    if (!empty(trim($_POST['catname']))) {
        $name = $_POST['catname'];
        $categ = new category();
        $categ->insert($name);
    }
}
include 'header1.php';
?>
<form action="addcategory.php" method="post">	
<div id="inside">
	<div class="container">
	<div class="row">
    <table class="table table-bordered table-hover table-striped table-responsive">
		<tr><th colspan="2"><h2>Add new category</h2></th></tr>

		<tr>
			<th>category name</th>
			<td><input type="text" name="catname"/></td>
		</tr>
		<tr>
			<td></td>
			<td id="submit"><input type="submit" name="Add" value="Add" ></td>
		</tr>
	</table>

</form>
<br/>
开发者ID:InasAbdelfattah,项目名称:bootstrap,代码行数:31,代码来源:addcategory.php

示例2:

     if (empty(trim($_GET['name']))) {
         $errors[] = "the name is empty";
         $_SESSION['errors'] = $errors;
     }
     if ($category->category_is_exist($_GET['name'])) {
         $errors[] = "the category is already exist";
         $_SESSION['errors'] = $errors;
     }
     if (empty(trim($_GET['desc']))) {
         $errors[] = "the desc is empty";
         $_SESSION['errors'] = $errors;
     }
     if (empty($errors)) {
         $category->category_name = $_GET['name'];
         $category->category_desc = $_GET['desc'];
         $category->insert();
     }
     $data = $category->getallcategory();
     $response1 = [];
     $response1[] = $data;
     $response1[] = $errors;
     $jsondata = json_encode($response1);
     echo $jsondata;
     // $category = new category();
     // $category->category_name = $_GET['name'];
     // $category->category_desc = $_GET['desc'];
     // $category->insert();
     // $data = $category->getallcategory();
     // $jsondata = json_encode($data);
     // echo $jsondata;
 } else {
开发者ID:sherif700,项目名称:ourWork,代码行数:31,代码来源:category_server.php

示例3: category

	  <button type="reset" name="cancel" class="red"><?php 
    echo $language['cancel'];
    ?>
</button>
	</div>

	</form>

	<?php 
} else {
    if (isset($_REQUEST['published'])) {
        $_REQUEST['published'] = true;
    } else {
        $_REQUEST['published'] = false;
    }
    $object_category = new category();
    $object_category->setContent($_REQUEST['title_1'], $_REQUEST['content_1'], $_REQUEST['title_2'], $_REQUEST['content_2'], $_REQUEST['title_3'], $_REQUEST['content_3'], $_REQUEST['title_4'], $_REQUEST['content_4'], $_REQUEST['title_5'], $_REQUEST['content_5'], $_REQUEST['title_6'], $_REQUEST['content_6'], $_REQUEST['code']);
    $object_category->setUserId($account["name"]);
    $object_category->setDate();
    $object_category->setDateUpdate();
    $object_category->setPublished($_REQUEST['published']);
    $object_category->setCategoryType($_REQUEST['section']);
    if ($object_category->insert()) {
        print 'sucess';
    } else {
        print 'failure';
    }
}
?>
</div>
开发者ID:DaniJCV,项目名称:BO2-BOxygen,代码行数:30,代码来源:category_add.php


注:本文中的category::insert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。