草庐IT

CodeIgniter-combobox

全部标签

php - Codeigniter like, or_like 不适用于 where

我在我的codeigniter应用程序中发现了一个问题。我使用4个不同的like和or_like编写了一个简单的搜索查询。$q=$this->db->select('*')->from('table')->like('col',$search_string1,both)->or_like('col',$search_string2,both)->or_like('col',$search_string3,both)->or_like('col',$search_string4,both)->get()->results它按我想要的方式工作,但我决定在我的表中添加名为“active”的新

php - Codeigniter 从数据库中删除行

只是想通过传递id从数据库表中删除行。请帮助我正确地从View中传递id。任何帮助将不胜感激。如果需要任何详细信息,请告诉我,以便我提供。这是我的模型:publicfunctiondid_delete_row($user_id){$query=$this->db->get_where('users',array('user_id'=>$user_id));if($query->num_rows()==1){if($this->db->delete('users',array('user_id','email','name','city'))){returntrue;}else{retu

选择项目时禁用Combobox关闭

我有ComboBox使用习俗ComboBoxItem.ComboBoxItem包含TextBlock和CheckBox.CheckBox在我的ViewModel中绑定到Bool属性。当我单击CheckBox,一切都很好,但是当我单击TextBlock-ComboBox闭幕!我需要“多登录”模式ComboBoxXAML:VM:publicclassSomeClass:INotifyPropertyChanged{privatestringm_caption;privateboolm_isSelected;publicstringCaption{get{returnm_caption;}set{i

php - 如何使用 codeigniter 中的事务根据数据更改进行提交和回滚?

我想了解如何使用MYSQLTRANSACTIONS。我有一个用例,我有两个表。比方说表1和表2。现在我在Table1中插入一些数据,并且从该表中获取的insertid我想将其插入到表2中。如果值在Table1中成功插入,并且在插入Table2值期间如果发生任何错误,我也想从Table1中删除这些值,因为对我的Table2的查询不成功。我只想了解如何使用Codeigniter完成此操作。如何根据需要提交或回滚。请帮助我提供一些示例代码以帮助我理解。更新我还提到了Codeigniter用户指南。但是我不明白手动运行事务的概念这是什么意思?如上所述,我想做一些类似自动触发的事情,我的意思是,

php - 事务无法在 codeigniter 中回滚

我正在处理事务,在提到的代码中我遇到了一些问题。我没有提交事务,但它向我的数据库中插入了数据。$this->db->trans_begin();$this->db->insert('tblorder',$data);$orderid=$this->db->insert_id();foreach($orderItemListas$orderItemList){$orderitem=array('orderid'=>$orderid,'productid'=>$orderItemList->productid,'amount'=>$orderItemList->amount);$this-

php - CodeIgniter mySQL 2 表左外连接

大家。我正在使用CodeIgniter,但我没有得到此查询的结果:$this->load->database();$this->db->select('*');$this->db->from('users');$this->db->join('show_guides','show_guides.user_id=users.user_id');$this->db->where('users.user_id',$user_id['user_id'],'leftouter');$query=$this->db->get();foreach($query->result_array()as$r

php - 使用 codeigniter 将字符串日期时间插入到 mysql 数据库中

我有以下MySQL表EventIdObjectKeyTitleDescriptionWhenDurationWhereStatusINTCHAR(36)VARCHAR(500)VARCHAR(8000)DATETIMEVARCHAR(500)VARCHAR(500)TINYINT我的PHP数组是$data=array('Title'=>$title,'Description'=>$description,'When'=>$when,'Duration'=>$duration,'Where'=>$where);变量$when包含02/21/2013。当我尝试使用CodeIgniter插入

php - Codeigniter更新记录

我在使用Codeigniter框架更新记录时遇到了一些问题。我正在使用MVC模式和事件记录。该代码用于更新用户配置文件。在我的模型中,Profile_model我有一个更新函数...functionprofile_update(){$this->db->where('user_id',2);$this->db->update('user_profiles',$data);}ControllerProfile_crud应该从表单中检索数据并将数据发送到模型。functionupdate(){$data=array('country'=>$this->input->post('countr

php - Codeigniter Activerecord 更新方法拒绝插入 NULL 值

我正在使用Codeigniters事件记录库对我的数据库中的列执行更新。这是表的SQLCREATETABLE`schedules`(`id`INT(11)NOTNULLAUTO_INCREMENT,`reservation_id`INT(11)NULLDEFAULTNULL,`title`VARCHAR(255)NOTNULL,`description`VARCHAR(512)NULLDEFAULTNULL,`start_date`DATENOTNULL,`start_time`TIMENOTNULL,`end_time`TIMENULLDEFAULTNULL,`enabled`TIN

php - Codeigniter Active Record - 计算总发现行数 (MySQL)

我在应用了限制的Codeigniter模型中使用复杂的SQL查询。我想计算在未应用限制和偏移量的情况下会找到的总行数。我想将计数连同结果数组一起返回到我的Controller-我该怎么做?如果这是正确的解决方案,我应该把SQL_CALC_FOUND_ROWS放在哪里?这是查询(最初不是我自己构建的):$this->db->select('table1.*,table2.*,table3.*,table4.*,table5.*,table6.*,table7.*,table8.*,table9.*,(SELECTGROUP_CONCAT(field1)FROMtable10WHEREta