CodeIgniter 4 has a handy solution for migrations and seeders. Without the usage of foreign keys, everything is working perfectly. But when I use foreign keys I get “Unable to add foreign key”. This is because of the order of happenings: Quick example: So when I now run php spark migrate or php spark migrate:refresh the foreign key can not
Tag: codeigniter
how to push data object to array of object in php
i have data array nested in hire , how to push new value to array [‘data’] ? The data I have is an object and I want to insert the data into each array result AND this my code i have code I have a data object that I want to insert into [‘data’] How to do it Answer I
CodeIgniter 4: Pass $data to the View file
Can someone help me with this? I can’t figure out on how can I show the results on the View file. I tried using $this->load->view(‘list-logs’,$data); but it shows the error Call to a member function view() on null. CONTROLLER VIEW Answer if you use CodeIgniter 4 then you must call the view ont controller like this:
How to view data based on values ​from database ci3 [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 months ago. Improve this question I want to make a recapitulation of absent data, which I display using a table in CI. The problem that occurs to me is that
CodeIgniter 4 Route url not found “The requested URL was not found on this server.” deployment on Heroku
Greetings I have a problem with my application in CodeIgniter 4, recently I moved all my websites to Heroku and for this website what is built in CodeIgniter 4 https://myconfessio.com/ only the index/home page look right but when I try to go to another page or do something else I get the error Not Found The requested URL was not
Codeigniter loop to chunk query only ever gets the first chunk of rows?
I’m trying to get a large amount of data by grabbing it in chunks from the database and writing it to CSV. For some reason the code below is only writing the first chunk (2000 rows) to CSV. I have my $chunk and $limit variables writing to a text file, and those are going through the loop and writing out
Using count_all_results or get_compiled_select and $this->db->get(‘table’) lists table twice in query?
How do I use get_compiled_select or count_all_results before running the query without getting the table name added twice? When I use $this->db->get(‘tblName’) after either of those, I get the error: If I don’t use a table name in count_all_results or $this->db->get(), then I get an error that no table is used. How can I get it to set the table
How to get multidimensional array grouped by multiple columns in PHP from single MySQL table?
I have table called “guids” that looks like this: From that I would like to get data in this format: Basically, I need to use multiple columns to build a nested array with grouped data. I know that I can achive that structure using foreach loop like this: But if possible I would like a more optimized solution on the
How to create multidimensional array unlimited depth array with parent and child came from single table
Im trying to create multi-dimesional array with unlimited depth. I select the data from the database and check it if the field ‘isArray’ is true, meaning this column is a parent then I tried to make a loop to make it look for its child ‘parent_id’ => $row->id. I’m expecting output like this. And the data I get from the
Otp is not post in database
after user submit mail id otp will be sent to that email id but my code isn’t working it post the email id in database but not the otp. Please can any one help? Controller Code auth.php Model code user_model.php Answer In your controller you are actually passing three arguments to the $this->user_model->insert() instead of two. Second argument needs to