我有这样的查询:
SELECT RIGHT(id, 1) id_root
FROM user
WHERE LENGTH(id) = 3
and LEFT(id, 1) = '0'
Run Code Online (Sandbox Code Playgroud)
以及如何将该查询转换为活动记录codeigniter.
我的问题是语法RIGHT( id, 1 ),也是LEFT(id,1)='0'
我正在使用 codeigniter 并有一个注册表单,可以捕获基本信息,例如电子邮件、用户名和密码。我还将有一个使用条款复选框,需要选中该复选框才能完成注册。
我的问题是我应该将它存储在数据库中吗?如果是这样,它是否应该存储为位 (1,0)?
我正在尝试上传图像和调整图像大小.我想要图像原始图像和拇指图像.
但问题是图像调整大小代码不起作用.
图像上传代码工作正常,它将图像存储在文件夹中,但图像大小调整代码不起作用.
我怎样才能做到这一点 ?
这是我的代码
public function add_images(){
$this->form_validation->set_rules('description','Description','required');
$this->form_validation->set_rules('status','Status','required');
if($this->form_validation->run() == TRUE) {
// print_r($this->input->post());
$config['upload_path'] = 'public/img/inner_images/';
$config['allowed_types'] = 'gif|jpg|jpeg|png'; // upload only valid images
// update library setting of upload
$this->load->library('upload', $config);
//upload image
$this->upload->do_upload('image');
$fInfo = $this->upload->data(); // get all info of uploaded file
//for image resize
$img_array = array();
$img_array['image_library'] = 'gd2';
$img_array['maintain_ratio'] = TRUE;
$img_array['create_thumb'] = TRUE;
//you need this setting to tell the image lib which image to process
$img_array['source_image'] = $fInfo['full_path']; …Run Code Online (Sandbox Code Playgroud) 我创建了amMap来绘制区域,我想禁用工具提示并在特定状态下点击添加infowindow.我怎样才能做到这一点.
codeigniter ×3
mysql ×2
php ×2
activerecord ×1
amcharts ×1
ammap ×1
database ×1
image ×1
jquery ×1
sql ×1