本文整理汇总了PHP中crud::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP crud::insert方法的具体用法?PHP crud::insert怎么用?PHP crud::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类crud
的用法示例。
在下文中一共展示了crud::insert方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: registraOpcao
public function registraOpcao(array $opcoes)
{
parent::setTabela('sebraeprev_enquete_opcoes');
$this->deleteOpcao();
foreach ($opcoes as $opcao) {
parent::sanitize($opcao);
$resultado = parent::insert(array('titulo' => $opcao, 'id_enquete' => $this->id_enquete));
}
return $resultado;
}
示例2: array
<?php
include "../../connection/phpmysqlconnect.php";
include "../../lib/CRUD_lib.php";
include "../../lib/miss_lib.php";
// post data
// File processing
$ext_array = array("jpeg", "jpg", "png");
$mime_array = array("image/jpeg", "image/jpg", "image/png");
$location = "../../media/featured_product/";
$image = new uploader();
if ($image->upload_validate($_FILES['files'], $ext_array, $mime_array) == true) {
$image_name = $image->upload($_FILES['files'], $location);
$column = array('logo');
$value = array($image_name);
$insert = new crud($conn, 'featured-product', $column, $value);
$insert->insert();
$move = new alert_redirect();
$move->moveWithAlert('Logo has been added', '../../pages/distributor-logo.php');
}
$move->moveWithAlert('Error in uploading image', '../../pages/distributor-logo.php');
示例3: crud
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<button type="submit" class="btn btn-lg btn-primary" name="submit" value="Submit">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div></div>
<?php
if (empty($nameErr) && empty($websiteErr) && empty($mpErr) && !empty($name) && !empty($website) && !empty($mp) && !empty($pubid) && empty($pubidErr) && empty($widgetErr) && !empty($widget2)) {
$crud = new crud();
$crud->insert($pubid, $name, $website, $piwik, $cache, $allowedParameters, $abtest, $mp, $widget2);
}
?>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
</body>
</html>
示例4: array
<?php
session_start();
// included files
include "../../../connection/phpmysqlconnect.php";
include "../../../library/CRUD_lib.php";
include "../../../library/miss_lib.php";
// post data
$user_id = $_POST['user_id'];
$name = $_POST['name'];
$role = 'customer';
$date_of_enrollment = $_POST['date_of_enrollment'];
$email = $_POST['email'];
$mobile = $_POST['mobile'];
$landline = $_POST['landline'];
$password = $_POST['password'];
$password = md5($password);
$modifier = $_SESSION["user"];
// insertion
$column = array('user_id', 'name', 'date_of_enrollment', 'email_id', 'mobile', 'landline', 'added_by', 'modified_by');
$value = array("{$user_id}", "{$name}", "{$date_of_enrollment}", "{$email}", "{$mobile}", "{$landline}", "{$modifier}", "{$modifier}");
$insert = new crud($conn, 'customer_details', $column, $value);
$insert->insert();
$column1 = array('user_id', 'role', 'password', 'added_by', 'modified_by');
$value1 = array("{$user_id}", "{$role}", "{$password}", "{$modifier}", "{$modifier}");
$insert1 = new crud($conn, 'login_details', $column1, $value1);
$insert1->insert();
$move = new alert_redirect();
$move->moveWithAlert('New User Customer has been added', '../../pages/add-customer.php');