我继承了一些自定义CMS的代码,这个代码有点超出了我的联盟,并且一直在绊倒相同的错误.注意:未定义的变量:/Applications/MAMP/htdocs/Chapman/Chapman_cms/admin/team-2.php中的媒体第48行.这应该创建新用户并编辑旧用户.但是,当我尝试添加新用户时,它不起作用.
以下是相关代码:
$db = new database("mysql",$dbHost,$dbName,$dbUser,$dbPass);
$target = 'add';
if ($_GET['task'] == 'edit') {
$media = $db->get_row(edit_media_item($db, $_GET['team_id']));
$target = 'update';
<p><label for="copy">Full Name:</label>
<input type="text" name="title" value="<?=$media['title']?>" />
<textarea name="media" id="media" cols="30" rows="5" style="width: 100%"><?=$media['copy']?></textarea></p>
<input type="hidden" name="process" value="<?=$target.",copy,4,team-1,".$media['id'].""?>">
<p><input type="submit" name="save" value="Submit" />
<input type="reset" name="reset" value="Reset" /></p>
</form>
Run Code Online (Sandbox Code Playgroud)
任何帮助将非常感激.
我检查所有堆栈站点并谷歌它也.但我无法找到适当的解决方案.
有没有想过这个?
问题是数据没有插入购物车.我将控制器数据中的数据回显到控制器中.但是没有插入购物车?
调节器
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Cart extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->library('session');
$this->load->model('Product_Model');
$this->load->library('cart');
}
public function index()
{
}
public function insert_cart()
{
$data = array(
'id' => $this->input->post('id'),
'qty' => $this->input->post('qty'),
'price' => $this->input->post('price'),
'name' => $this->input->post('head'),
);
$cartdata = $this->cart->insert($data);
if(!empty($cartdata)){
print_r($cartdata);
}else{
echo "no data";
}
// $count = $this->cart->contents();
// print_r($count) ;
die();
}
}
Run Code Online (Sandbox Code Playgroud)
在视图ajex数据发送.
<script>
$(function(){
$( "#submit" ).click(function(event) { …Run Code Online (Sandbox Code Playgroud) 如何使用给定的语法在CodeIgniter中显示数据库表名列表:
$tables=$this->db->query("SHOW TABLES LIKE '%Demo%'");
Run Code Online (Sandbox Code Playgroud) 嗨,我使用 codeigniter 和 bootstrap 开发了一个网站,我在我的管理页面中上传了 youtube url,并使用 iframe 在我的视图页面中获取该 url 并加载该 url。但是youtube视频没有显示当我检查网站时,错误显示如下
拒绝在框架中显示“ https://www.youtube.com/watch?v=7Ct59FQIbAU ”,因为它将“X-Frame-Options”设置为“sameorigin”。广告:522 GET https://www.youtube.com/watch?v=7Ct59FQIbAU net::ERR_BLOCKED_BY_RESPONSE
当我检查这个网站时,网址显示但视频没有显示..这是那个网站网址 www.clicx.in/pixelerror
在我的本地服务器中它的工作
视图代码是
<div class="container">
<div class="row">
<?php foreach($advertisement as $ad) { ?>
<!-- 4:3 aspect ratio -->
<div class="embed-responsive embed-responsive-4by3">
<iframe class="embed-responsive-item" src="<?php echo $ad->url?>"></iframe>
</div>
<?php }?>
</div>
</div>
Run Code Online (Sandbox Code Playgroud) 您好我想命令部署没有种子的整个数据库.我还有一些与laravel相关的问题.我想将以下sql查询转换为laravel eloquent格式.
select * from user where id = '123' and password = 'abcd';
select name, address from user where lower('name') like lower('%Jerry%');
Run Code Online (Sandbox Code Playgroud) 我是Laravel的新人.如何将以下查询转换为Laravel where子句.
where category='1' and (shipping_from='1' OR shipping_to='2')
Run Code Online (Sandbox Code Playgroud) 我正在为工作做一个基本的添加用户表单,我正在尝试将用户添加到数据库但是当我尝试时,我只是得到主键是重复错误.很确定解决方案是正确的看着我,但我今天碰壁了大声笑.
数据库表struture
dbo.ci_users
id(PK, int, not null)
user_name(nchar255, not null)
user_email(nchar255, not null)
user_password(nchar255, not null)
user_displayname(nchar255, not null)
user_active(smallint, not null)
user_level(smallint, not null)
Run Code Online (Sandbox Code Playgroud)
Adduser_model
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class adduser_database extends CI_Model {
function __construct()
{
// Call the Model constructor
parent::__construct();
$this->load->database();
}
public function insert_into_db()
{
$data = array(
'id' => '0',
'user_active' => '1',
'user_level' => '2',
'user_displayname' => $this->input->post('user_displayname'),
'user_email' => $this->input->post('user_email'),
'user_name' => $this->input->post('user_name'),
'user_password' => $this->input->post('user_password')
);
$this->db->insert('ci_users', …Run Code Online (Sandbox Code Playgroud) 我需要在 java 中使用正则表达式从字符串中删除加号 (+)。
+876755444应该能够删除+然后它应该显示为876755444。
我正在尝试这样做并且也是正则表达式的新手。
谁能告诉我如何做到这一点。
我有桌子电话Category.

如果我使用
query = $this->db->query("SELECT * FROM category WHERE id='$id'");
$result = $query->result_array();
return $result;
Run Code Online (Sandbox Code Playgroud)
这将加载所有结果.(Id 1至id 12)
问题是:我想获得更重要的ID id 10.
我希望查询后,我只需要id 11和id 12进行负载.(ID会继续增加).
那么我怎么能用CodeIgnitor用PHP做到这一点?