I am generating some dynamic content in the view layer of my codeigniter project. The trouble is, I am getting the following error in my ternary expression: Parse error: syntax error, unexpected token “foreach” How can I display the looped category_name data separated by <br/> tags without generating this error when $log->category is not declared? Answer The code you have
Tag: codeigniter
Searching by name and date between codeigniter 4
Hello everyone I’m creating report through the fetched data, I created search based on category, amount and date between. But the problem is that, If I entered category and trigger the search button I get the data, And If I set the dates between to range it aslo returning the data. But if I set both category and dates between
How to remove cache files or images in Codeigniter 3.1.9
I have an image gallery where too many images are saved and displayed on a single page with update option with every image. When I upload a fresh image, it works fine. But when I change an image by uploading a new image file, it works fine on localhost (xampp) but not working on cpanel server and digital ocean server
codeigniter google login with existing gmail account creating duplicate row
I have implemented google login in existing user table in coeigniter. User can login whether with existing email and password or from google login. Everything working fine but i need to check with existing email. Suppose that gmail already in the database i need to update the oauth_provider and oauth_uid in the existing row. Right now creating new row for
how can I download my file residing in local repository
I am new to CodeIgniter and was working on downloading a file. However, I want to download a file that resides on my local machine, I am able to locate the file by providing the path, also the file gets downloaded with a File type, However, I want my file to be in .csv format Here goes my Controller’s download
php/codeigniter firestore update giving error InvalidArgumentException Input missing required one or more required keys
I am trying to connect admin panel on php-codeigniter with firestore/firebase . Insertion,Fetch and Set functions are working fine but when I try to update ( update a single key ) it gives InvalidArgumentException . I am following the official documentation here . I am new to firestore. Suggestions are appreciated. Here’s my code Error Output Answer According to my
how to select multiple sum() quantity
i want to select the sum of quantity(qty) from orders table,there are 2 category dirham (kupon_id = 2) and dinar (kupon_id = 1) i already got the sum of kupon_id = 2,but i dont know how to get sum of qty where kupon_id = 1,here the example : my model : i tried join the same table with difference WHERE
Failed while installing a package using composer
iam tryin to use a cart package by using this command composer require jason-napolitano/codeigniter4-cart-module and it’s failed. this is what it said is it because my minimum-stability in composer.json is set to “stable”? Answer I presume you created your project by using composer create-project codeigniter4/framework. This effectively created a clean project for you without the .git folder, thus removing any
Connecting Database Codeigniter 4 With Custom Ports
So, I’m trying to connect to my database container from my webserver container. I currently use Codeignter 4 for my PHP framework. Everything goes well in terms of communicating between different containers because that container is inside the same networks. Inside webserver container, I’ve tried to ping from and to database container with no problem, All the port is accessible
ajax code contains “PHP site_url” with parameters in ajax
I want to ask, is it possible, if the ajax code contains “PHP site_url” with parameters in ajax this is the specific code: this is the full code: Answer please try this