I would like to get the ancestral or child data when I pass the value in a function. This is my data from MySQL table. If I pass the value of Document2 in my function i want to get the ancestral data, for example, if I pass Document2 it will get the Book2 then the Book2 will get the Document1
Tag: codeigniter
Display table line following condition – codeigniter
I have a table in our admin panel. The table display the coupon and the deal, but for a better reading we would like to have a split table. 1 for coupons and 1 for deals. I can’t figure out how to display only the data according to the status if deal or coupons. Here below is my loop to
Displaying an Alertbox from PHP Controller class
Currently I’m in my controller and I have placed a check in the controller. Basically checking if the value of a particular field is 0 or not. Now if it is 0, I want to display an alert popup via my controller. To do this I’ve tried the following code: Now it is entering my if condition, but it doesnt
Updating multiple tables in SQL using an Array
Currently I had a table called crm_leads for my Leads page where I already have many records. Now for the same page I have created few new fields which is now going to be stored in another table called crm_leads_details. Now I’m storing all my POST values in an array format like so: Now in my model I’m trying to
Codeigniter form helper setting input class on edit form
I am using ion auth to edit some user data.This is the code This produces the input plus the value but without the input class My first code snippet is an attempt at adding input class and populating the input field. This gives me a conversion error Message: Array to string conversion How should i add form class inside the
How to upload file into folder after saving form
I am trying to upload files through this form but it’s only saving the name of the file into the database. I want that when the form submit then the file is uploaded to the destinated folder and the form submitted successfully, below I have provided both view and controller code Form view code: Form controller code: Answer
How to add a confirm dialog box using SweetAlert2 in CodeIgniter 3?
I’m learning CodeIgniter 3 and I want to add a confirm dialog before deleting a row in the database table. I’ve made the delete function but couldn’t figure out how to add a confirm dialog box using SweetAlert2. code in view code in controller code in model Answer Here is a simple integration, try and let me know
Creating an auto incremented id when user submits a form
Currently I have a refno. column in my database with the format LP00001. Now I have a add page that inserts all data that the user inserts in the input field and all this data gets sent to a table in my database, but my refno column stays null which I want to have an auto incrementing value where the
Accessing php variable from within function scope
I have this code in a codeigniter controller that’s the beginnings of a pagination/sorting feature for a table in the view. I’m passing order_by as a query parameter and then this is part of the controller action: The problem is…I keep getting the error Undefined variable: order_by. Since I’m checking that $order_by exists in the if statement, why am I
Codeigniter Print Domp PDF Page Break Limit 5 records per page In table foreach
I want to show only 5 records data per page in print pdf. This is my code : Data is show correctly but any zero in my table in second and next page, like this image below : how to use the code below correctly, ? Answer I have solved this, my table is look good now. Thank you :