I have an urbanairship account set up to send push notifications to my app. This is all working, but now I'm trying to integrate it with my codeigniter admin site so that push notifications are sent by UA and stored to a database in one step. I'm trying to use the cURL library and following the UA API documentation,(http://urbanairship.com/docs/push.html), but each time I get a 404 error. However if I take the cURL lines out, the data is added to …
我目前正在使用Phing和Jenkins来自动化我的CodeIgniter应用程序的构建和部署.我遇到的一个问题是重启apache服务.我试过Phing但是没有足够的权限.重启的最佳方法是什么?
编辑:
将jenkins添加到sudoer文件并执行服务httpd restart后,Jenkins抛出:处理泄露的文件描述符.下面是Jenkins的Phing输出片段.它说一个解决方法是安装daemonize.不确定那是什么意思...
...Build_test > compress:
[echo] YUI Compression started
[echo] Replacing normal JS with compressed files.
[echo] Replacing normal CSS with compressed files.
[echo] chmoding assets
[echo] YUI Compression ended
Build_test > pdepend:
Build_test > httpd_restart:
[echo] Stopping httpd: [ OK ]
[echo] Starting httpd: [ OK ]
BUILD FINISHED
Total time: 13.1424 seconds
Process leaked file descriptors. See http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build for more information
[JDepend] JDepend plugin is ready
[JDepend] Found 68 classes in 1 packages
Finished: SUCCESS
Run Code Online (Sandbox Code Playgroud) 我只是试图从codeiginitor的mysql表中获取最新的自动生成密钥.但它并没有起作用.我已经尝试过这个代码
$this->db->insert_id()
以及
$this->db->mysql_insert_id()
我得到以下错误
是mysql不支持insert_id函数?我们怎样才能让它发挥作用?
Severity: Notice
Message: Undefined property: CI_DB_mysql_driver::$insert_id
我有一个带有2列ID的DB,它引用了同一个表
如何对同一个表进行2次连接,并能够提取数据.
这是我有的:
$this->db->select('s.id, c.title, c.description, s.time ,s.day,s.instructor_change,s.studio_change,s.time_change,s.new_class,s.reservation_req,s.easy_does_it,s.mind,s.level,s.duration,s.location,i.first,i.last');
$this->db->from('schedule as s');
$this->db->join('instructors as i', 'i.id = s.instructor_id','inner');
$this->db->join('classes as c', 'c.id = s.class_id');
$this->db->where('s.active', '1');
$this->db->where('s.day', $dayofweek);
$this->db->order_by('s.time',"ASC");
$query = $this->db->get();
Run Code Online (Sandbox Code Playgroud)
我还要拉这样的东西$ this-> db-> join('instructors as i','i.id = s._alt_instructor_id ');
我如何两次加入同一个表,但是能够在这种情况下再次为同一记录中的另一个ID提取名字和姓氏?
回答
$this->db->select('s.id, c.title, c.description, s.time ,s.day,s.instructor_change,s.studio_change,s.time_change,s.new_class,s.reservation_req,s.easy_does_it,s.mind,s.level,s.duration,s.location,i.first,i.last,a.first as alt_first,a.last as alt_last');
$this->db->from('schedule as s');
$this->db->join('instructors as i', 'i.id = s.instructor_id','left');
$this->db->join('instructors as a', 'a.id = s.alt_instructor_id','left');
$this->db->join('classes as c', 'c.id = s.class_id');
$this->db->where('s.active', '1');
$this->db->where('s.day', $dayofweek);
$this->db->order_by('s.time',"ASC");
$query = $this->db->get();
Run Code Online (Sandbox Code Playgroud) 我想从我的codeIgniter应用程序重定向到www.yahoo.com.我写这样的代码:redirect("http://www.yahoo.com");
它在我的本地计算机(Windows Vista/WAMP)中工作正常但是当我上传到Linux服务器时它只显示空白屏幕而不是重定向.
我将一个像'测试'这样的值传递给我的表单,然后通过执行以下操作来获取值:
$this->input->post('field_name');
Run Code Online (Sandbox Code Playgroud)
我发现我无法取回'测试'的价值,我一无所获.
我的版本是2.0.2,而且 $config['charset'] = 'UTF-8';
如果我echo('??'),没有问题.
使用拉丁字符,可以完美打印.我该如何解决?
代码从表格:
表格
<form target="sc_light_box" action='http://localhost:8888/my_project/index.php/data/add_data.php' method="post">
<textarea id="field_name" name="field_name"/>
<input type="submit" id="submit_button">
</form>
Run Code Online (Sandbox Code Playgroud)
控制器:
public function add_data()
{
$this->_load_add_data_page();
}
private function _load_add_data_page()
{
$this->load->library('form_validation');
$this->load->library('table');
$this->load->helper('form');
$data['field_name'] =$this->input->post('field_name');
$this->load->view('add_data_page_view', $data);
}
Run Code Online (Sandbox Code Playgroud)
风景:
Run Code Online (Sandbox Code Playgroud)<?php echo $field_name?>
我试图检查,如果用户创建了包含符号(包括+, - ,=符号)OR/AND号的密码.我怎样才能做到这一点?
function check_password($str)
{
if (!preg_match ("/[&@<>%\*\,\^!#$%().]/i", $str))
{
$this->form_validation->set_message('check_password', 'Your password should contain a number,letter,and special characters"');
return FALSE;
}
else
{
return TRUE;
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢.
我正在开发一个Web应用程序,其中有许多我希望用户浏览的非常相似的页面.这些"页面"的数据存储在具有唯一ID作为主键的数据库中.
我希望在每个页面上都有一个"NEXT"按钮,用于查询数据库并找出下一个最高ID是什么,并显示该id的数据.我的问题是有几个条件:
有没有人有任何提示或建议?谢谢!
以下是可用于访问资源的基于REST的有效URL:
使用codeigniter,如何访问下面传递的1的参数.

我在教程中看到了上面的内容,并设置了我的代码.但显然:
$id = $this->input->get('id');
Run Code Online (Sandbox Code Playgroud)
不起作用.
首先抱歉,如果它是一个菜鸟问题.
但它是否可以在codeingiter中执行此操作,就像我有一个侧边栏但我只想加载它2页
if(controller == 'blog') {
//load sidebar
}
Run Code Online (Sandbox Code Playgroud)
就像在wordpress中一样is_page