<?php
/**
* 创建课程新数据 PHP接口源代码
*
* 接口说明:演示添加一条新数据到表单,使用前请先安装okayapi_course表单
*
* 最后修改:2024-10-12 12:14:01
*
* @author dogstar www.yesapi.cn
*
* 来源:https://open.yesapi.cn/apicode/342.html
*/
function ($params, $di) {
$result = array('err_code' => 0, 'err_msg' => '');
$data = array();
$data['course_id'] = $this->course_id;
$data['course_name'] = $this->course_name;
$data['course_url'] = $this->course_url;
$data['course_desc'] = $this->course_desc;
$data['course_instructor'] = $this->course_instructor;
$data['course_thumbnail'] = $this->course_thumbnail;
$data['course_start_time'] = $this->course_start_time;
$data['course_end_time'] = $this->course_end_time;
$notorm = $di->db->okayapi_course_tbl;
$notorm->insert($data);
$result['id'] = $notorm->insert_id();
return $result;
}
在线运行
创建课程新数据 - 免费接口源码库
持续更新中…… 免费使用,一键生成你的API
+ 复制到我的接口(请先登录,支持在线开发API)
预览接口发布效果
查看开发教程