codeigniter

Illegal mix of collations for operation '='

坚强是说给别人听的谎言 提交于 2020-01-05 04:16:14
问题 I want to select data from table 'invoice_data' where the value of company name will be choosen from the table 'crm_accounts' by value of email. I am getting error like Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '=' This is my model code: public function view_invoice($email) { $this->db->select('invoice_data.*, crm_accounts.company'); $this->db->from('invoice_data'); $this->db->join('crm_accounts', 'invoice_data.cname = crm_accounts

CodeIgniter custom value with omnipay

限于喜欢 提交于 2020-01-05 04:11:08
问题 I'm trying to pass a custom value to a payment with PayPal - OmniPay Here is the code I use : $response = $gateway->purchase( array( 'cancelUrl'=>base_url().'checkout/cancel', 'returnUrl'=>base_url().'checkout/confirm', 'amount' => number_format($retn['invoiceDatas']['price'], 2, '.', ''), 'description' => 'Facture #'.$id, 'currency' => 'EUR', 'transactionid'=> $id, 'custom' => $id, 'description' => 'Facture' ) )->send(); $response->redirect(); And here is the code from checkout page :

How to store uploaded file into folder using CodeIgniter?

喜你入骨 提交于 2020-01-05 04:03:24
问题 How to store upload file into folder using CodeIgniter? 回答1: Please Be sure with your gallery folder it must be in root alongside with application folder name gallery $config['upload_path']='./gallery/'; $config['allowed_types']='gif|png|jpeg|jpg'; $config['max_size']='100'; $config['max_width']='1024'; $config['max_height']='700'; $this->upload->initialize($config); $this->upload->do_upload('upload_photo'); 回答2: Hey try this code inc controller. This the function when u hit the upload button

Get next and previous row from record set

倖福魔咒の 提交于 2020-01-05 03:42:47
问题 I am trying to retrieve the next row in my database using Codeigniter's active record. Model public function getNextRow() { $this->db->where('id', 1); $this->db->limit(1); $query = $this->db->get('portfolio_shots'); return $query->next_row(); } Controller public function test() { $nxt = $this->Portfolio_model->getNextRow(); echo $nxt->id; } Output Why am I getting the error "Trying to get property 'id' of non-object" 回答1: next_row() returns: Next row of result set, or NULL if it doesn’t exist

Unable to send email

China☆狼群 提交于 2020-01-05 02:54:13
问题 In the below codeigniter i want to send a email but i cant send it pls help me. <?php /** * SENDS EMAIL WITH GMAIL */ class Email extends CI_Controller { function index() { $config = Array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.googlemail.com', 'smtp_port' => 465, 'smtp_user' => 'sltechdevelop@gmail.com ', 'smtp_pass' => 'highschool', 'mailtype' => 'html', 'charset' => 'iso-8859-1' ); $this->load->library('email', $config); $this->email->set_newline("\r\n"); $this->email->from(

How to create an image watermark wm_type overlay in Codeigniter?

不问归期 提交于 2020-01-05 02:53:07
问题 I am trying to put an image over another image (watermark) like so: class Water_mark extends CI_Controller { function __construct() { parent::__construct(); } function index() { $this->load->library('image_lib'); $config['image_library'] = 'GD2'; $config['source_image'] = '/assets/images/tv-share.jpg'; $config['new_image'] = '/assets/images/tv-share-done.jpg'; $config['wm_type'] = 'overlay'; $config['wm_overlay_path'] = '/assets/images/share_en.jpg'; $config['wm_opacity'] = '50'; $config['wm

.htaccess Error in Codeigniter

扶醉桌前 提交于 2020-01-05 02:29:32
问题 I am new to Codeigniter I have put an .htaccess in root folder of codeigniter 2.1.3. I have tried my .htaccess file on both xampp & wamp server but this is not removing my index.php. I have also set $config['index_page'] = 'index.php'; to $config['index_page'] = ''; and here is my .htaccess code <IfModule mod_rewrite.c> RewriteEngine on RewriteCond $1 !^(index\.php|js|images|system\/plugins|robots\.txt|css\/) RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> i dont know why this is not removing

How to load class/library in CodeIgniter?

扶醉桌前 提交于 2020-01-05 02:23:38
问题 I have a library called lib , which contains a class called nusoap.php . I have put lib inside the folder application/libraries/ . When I try to load it, I'm getting the following error: An Error Was Encountered Unable to load the requested class: nusoap This the code I use to load it class Dealership extends Controller { function Dealership() { parent::Controller(); $this->load->library('nusoap.php'); } } Am I missing anything? Thanks for helping 回答1: You dont need the .php extension in the

Codeigniter REST API giving unknown method?

淺唱寂寞╮ 提交于 2020-01-04 18:19:50
问题 I'm using https://github.com/chriskacerguis/codeigniter-restserver with codeigniter. I'm trying to add a resource, and enable a get method with an id. I added the Users controller which inherits the REST_Controller. I added a few methods, index_get, index_post. They both worked perfectly. I then attempted to add an id parameter to the index_get function (so you can access a particular user- eg localhost/proj/Users/4 would you give you the user with id 4) class Users extends REST_Controller {

Getting my nav menu to work with CodeIgniter

徘徊边缘 提交于 2020-01-04 17:00:46
问题 Basically I have two controllers using CodeIgniter for a simple blog for a project at school. One is Home which is the login page. The other is Member for when they are signed in. in this member controller I am creating functions for add_post(), view_users_posts(), etc. Member.php class Member extends CI_Controller{ function __construct(){ parent::__construct(); $is_logged_in = $this->session->userdata('is_logged_in'); if (!isset($is_logged_in) || $is_logged_in !== true) { redirect('home'); }