codeigniter-3

How to pass array as parameter to stored procedure in mysql?

≡放荡痞女 提交于 2019-12-24 18:56:23
问题 I'm trying to pass array as parameter to my stored procedure. But I'm not getting expected result. I'm trying to send list of emails and ID's from view on button click to controller, and then I'm trying to fetch data from database by passing that list as parameter to my stored procedure. Here is my code: View: <form action="<?= base_url('certificate/sendMail') ?>" method="post"> <table id="example1" class="table table-striped table-bordered" cellspacing="0" width="100%"> <thead> <tr> <th>Mail

Codeigniter - Clone Data (But remove 1 column that is not exist )

不羁的心 提交于 2019-12-24 18:15:07
问题 What i am trying to do: Try to Clone Data (Update) from Table "Payment History" to "Payment" , But the problem right now is that in Payment History Table there is "PaymentHistory_ID" column , how do I ignore it ? Payment Table Payment_ID Payment_Amount Payment_Method Payment_Remark Payment History Table Payment_ID PaymentHistory_ID Payment_Amount Payment_Method Payment_Remark Both have the same column and same data type My Code: Controller public function updateHistory($Payment_ID){ $query =

Can't use CodeIgniter's LIKE()

和自甴很熟 提交于 2019-12-24 17:53:05
问题 Because of some bug or my lack of knowledge in ODBC connections I can't use CodeIgniter's $this->db->like(); (If you really want to know why I can't use it, see my other thread here.) How do I replace $this->db->like("name", 'a', 'after'); with some other safe code? EDIT: Obviously, I wasn't clear in my description. I KNOW how to use "like()". My problem is that I CAN'T use it because of other circumstances. What I need is a substitute for "like()". I know I could do it like: $this->db->where

Getting weird query string from Codigniter's LIKE()

强颜欢笑 提交于 2019-12-24 12:54:43
问题 I'm trying to make a simple query in Codigniter like this: $this->db->select("cats"); $this->db->from("pets"); $this->db->like("name", 'a', 'after'); And then show it: echo $this->db->get_compiled_select(); Result: SELECT cats FROM pets WHERE name LIKE 'a%' {escape '!'} For some reason CI adds {escape '!'} at the end. Which of course generates an error when I try to run the query. Database config: $db['pyramid'] = array( 'dsn' => 'pyramid', 'hostname' => '', 'username' => '', 'password' => ''

Return query result with if condition

给你一囗甜甜゛ 提交于 2019-12-24 12:28:43
问题 I have some table structure like this. table property_day propday_id | date | property_id | check_in | check_out ------------------------------------------------------ 1 | 2017-03-26 | 5 | 0 | 0 2 | 2017-03-27 | 5 | 0 | 0 3 | 2017-03-28 | 5 | 0 | 0 4 | 2017-03-29 | 5 | 0 | 0 table rooms room_id | name | property_id ---------------------------- 1 | Deluxe | 5 2 | Superior | 5 3 | Executive | 5 I want to show all that room with if condition inside query. I show that room with date check in and

Codeigniter session data or database query?

梦想的初衷 提交于 2019-12-24 08:18:30
问题 How can I show customer's or user's information such as Name and Surname on the header? Firstly, I have a login page. Customer and User can login to the dashboard on the same login page. While login process, it uses 2 database tables such as User and Customer. Login process system takes data from 2 database tables when customer and user login to dashboard. Model of LOGIN: private $table = "user, customer"; private $_data = array(); public function validate() { $username = $this->input->post(

Codeigniter session data or database query?

你离开我真会死。 提交于 2019-12-24 08:17:25
问题 How can I show customer's or user's information such as Name and Surname on the header? Firstly, I have a login page. Customer and User can login to the dashboard on the same login page. While login process, it uses 2 database tables such as User and Customer. Login process system takes data from 2 database tables when customer and user login to dashboard. Model of LOGIN: private $table = "user, customer"; private $_data = array(); public function validate() { $username = $this->input->post(

How to route URIs to application/controllers & still use Module::run in CI3 with HMVC

◇◆丶佛笑我妖孽 提交于 2019-12-24 05:48:38
问题 I only use the modules for partial views, they are never routed to directly. Instead I have main controllers inside application/controllers and views inside application/views/ which execute Modules::run($moduleName, $params); This invokes the module and renders fine, when reached. The problem is none of my routes are calling their application/controller/ methods . Meaning my routing has stopped working entirely and only the homepage defined by my route['default_controller'] works. Because my

codeigniter Session in Safari browser

混江龙づ霸主 提交于 2019-12-24 02:45:21
问题 We are using the following to check session on all our controller functions. $this->session->userdata('Admin_logged_in') https://www.codeigniter.com/user_guide/libraries/sessions.html But on iPhone X using the Safari browser, it returns an empty value. The session Array is not getting set for each function, so the user is unable to log into the interface. Here are different solutions we tried: CodeIgniter 3 Session not working on Safari http://mydons.com/fixed-mac-os-safari-codeigniter

Show sum of the dynamic price when click on radio button in jquery

徘徊边缘 提交于 2019-12-24 00:58:34
问题 I'm in very bad situation with a project which is related to a travelling website. I'm unable to figure out that how do I calculate the total amount of each passenger's preferred room type. I've two passenger's records in database. 1) Maggie 2) Esther The default price for each passenger's is 125000 and when if user click to choose his own room type then price is 150000 for the selected passenger. Here is the website on which I applying this : Website Tailor Page It is easy to do when the