Skip to content
Advertisement

Tag: codeigniter

Message: DateTime::__construct(): Failed to parse time string (21/12/2020) at position 0 (2): Unexpected character

while executing this statement, it gives following error: Type: Exception Message: DateTime::__construct(): Failed to parse time string (21/12/2020) at position 0 (2): Unexpected character What could be the reason for this error and what is the solution for it? Answer Try to replace slashes with dots or slash slashed (like 21/12/2020). Better don’t use slashes in that context.

Codeigniter 4 pagination with custome mysql query

In my Codeigniter 4 project i used $db->query(‘select * from myTable’) method to get data. (used this directly on controller without model) Is there way to initialize pagination with Codeigniter for this kind of stuff. I’m new to Codeigniter 4 and not worked $this->pagination->initialize($config); It says Call to undefined method CodeIgniterPagerPager::initialize() Is there way to overcome this issue without using

CI4 Inserting ID from selected Strings

I’m so tired of thinking how to solve this case. already search by internet and never solved. straight to the point this is my Controller of Product.php this is my Models Model_product.php and this is my Views create.php i want to insert new data from Controller Product function store. i’ve this problem, i cannot change string value into integer value

Undefined database variable

Blog.php code below: blog_index.php code below: I can’t see where is my mistake, it raises a errorException: “Undefined Variable:dados”. About $categorias variable, am learning how to use more than one table per controller. Codeigniter version: 4.0.4 Running through xampp Answer Controller Blog.php View blog_index.php Note :- For Reference see this:- https://codeigniter4.github.io/userguide/outgoing/views.html#adding-dynamic-data-to-the-view

Advertisement