Welcome Guest, Not a member yet? Register   Sign In
Search Results
    Thread: How to run Transactions in controller?
Post: RE: How to run Transactions in controller?

mlurie Wrote: (04-06-2021, 09:44 AM) -- Add this to your BaseController in the "Preload" section of the initController method: PHP Code: -- $this->db = \Config\Database::connect(); //Load databas...
3,895 Views
4 Replies
01-09-2023, 07:35 AM
mlurie
    Thread: Cant send Email over SMTP
Post: RE: Cant send Email over SMTP

This is probably not your issue, but for others who may stumble upon this thread, make sure your hosting provider allows outbound e-mail to go through an external SMTP server. Many hosts (including mi...
7,436 Views
5 Replies
11-30-2021, 08:16 PM
mlurie
    Thread: Entities and relationship
Post: RE: Entities and relationship

Personally, I like to use Entities to help with this. When there is a foreign key referencing another database table, I use SQL joins to pull in foreign data as part of a single SELECT statement.  The...
8,949 Views
9 Replies
10-26-2021, 09:09 AM
mlurie
    Thread: How insert null on save in select field
Post: RE: How insert null on save in select field

In your model, create the following method: PHP Code: -- protected function setDefaultIDMezzi(array $data) {     if(!isset($data['data']['id_mezzi']))         $data['data']['id_mezzi'] = NULL; ...
1,554 Views
2 Replies
10-26-2021, 08:35 AM
mlurie
    Thread: 404 Not Found from Android Home Screen Icon
Post: 404 Not Found from Android Home Screen Icon

I've just completed a project and everything is working perfectly except one nagging issue.  When I try to access the project's website from an icon added to my Android home screen either from Firefox...
822 Views
0 Replies
09-06-2021, 11:05 AM
mlurie
    Thread: Overwrite file instead create new file
Post: RE: Overwrite file instead create new file

Add "true" as the optional third parameter. PHP Code: -- if($file->move(WRITEPATH.'/uploads/my_dir/', $newName, true)) --
1,839 Views
2 Replies
07-19-2021, 12:09 PM
mlurie
    Thread: VScode - undefined 'getVar' method in version 4.1.2
Post: RE: VScode - undefined 'getVar' method in version ...

I found a solution on the PHP Intelephense GitHub page here: https://github.com/bmewburn/vscode-intelephense/issues/1670.  Add the following code to your Base Controller: PHP Code: --        /**...
7,903 Views
8 Replies
05-28-2021, 11:15 AM
mlurie
    Thread: How to run Transactions in controller?
Post: RE: How to run Transactions in controller?

Add this to your BaseController in the "Preload" section of the initController method: PHP Code: -- $this->db = \Config\Database::connect(); //Load database connection -- You should then be able...
3,895 Views
4 Replies
04-06-2021, 09:44 AM
mlurie
    Thread: Problem with redirect and routes
Post: RE: Problem with redirect and routes

First you will need to make sure make sure automatic routing is enabled and/or you have defined your custom routes in app\Config\Routes.php.  You can find the documentation here: https://codeigniter.c...
8,363 Views
7 Replies
03-27-2021, 07:39 AM
mlurie
    Thread: source code says Request::getMethod() is deprecated, what to use?
Post: RE: source code says Request::getMethod() is depre...

The method is not deprecated, the optional [$upper] parameter is deprecated. In the future the request method name will only be returned in lower case. You may review the documentation here: https:/...
14,088 Views
15 Replies
02-25-2021, 06:01 PM
mlurie
    Thread: Inserting/Updating "Userstamps" from a Model
Post: RE: Inserting/Updating "Userstamps" from a Model

Create a new custom model with the above functions that extends the CodeIgniter Model. Then in all of your other models, you will extend this new custom model instead of extending the CodeIgniter mod...
8,083 Views
15 Replies
12-21-2020, 07:13 AM
mlurie
    Thread: Number of results is wrong
Post: RE: Number of results is wrong

This is working as intended. countAll() returns the total number of rows in a table.  Use countAllResults() to get the number or rows returned by a query.  The documentation can be reviewed here: http...
1,806 Views
3 Replies
12-16-2020, 09:15 PM
mlurie
    Thread: Why unknow column 'slug_safelink' ?
Post: RE: Why unknow column 'slug_safelink' ?

Make sure you spelled 'slug_safelink' the same way in your MySQL database. I just ran into this today.
1,966 Views
3 Replies
11-09-2020, 02:57 PM
mlurie
    Thread: Assignment Operator := breaks the query builder
Post: RE: Assignment Operator := breaks the query builde...

Try adding the optional FALSE parameter to the select method documented here: https://codeigniter.com/user_guide/database/query_builder.html#selecting-data. PHP Code: -- $this->builder->select('*,...
1,140 Views
1 Replies
11-04-2020, 10:55 AM
mlurie
    Thread: Why unknow column 'slug_safelink' ?
Post: RE: Why unknow column 'slug_safelink' ?

Did you initialize the $allowedFields array in your Model? PHP Code: -- protected $allowedFields = ['nama_safelink', 'slug_safelink', 'url_safelink', 'hits_safelink']; -- Also, you don't really ...
1,966 Views
3 Replies
11-04-2020, 10:45 AM
mlurie
    Thread: Can I have 2 tables in codeigniter 4 model?
Post: RE: Can I have 2 tables in codeigniter 4 model?

I've never used CI3, but I have been able to accomplish what you describe in CI4 by using the standard CI4 model and Entities.  Create a method inside your model that joins other tables with your mode...
14,049 Views
10 Replies
10-28-2020, 06:46 PM
mlurie
    Thread: Multiple ignore-fields for is_unique-function
Post: RE: Multiple ignore-fields for is_unique-function

I'm not sure I am interpreting your question correctly, but in general, if you need two fields to be unique, you will need to create a separate validation rule for each field. If you are trying to ...
3,804 Views
4 Replies
10-28-2020, 06:02 PM
mlurie
    Thread: MySQL UNION statement and Query Builder?
Post: MySQL UNION statement and Query Builder?

Is there any way to write a MySQL UNION statement with Query Builder?  I have reviewed the documentation and cannot find the answer.
1,883 Views
2 Replies
10-23-2020, 02:06 PM
mlurie
    Thread: Form-Action Variables not working while routing
Post: RE: Form-Action Variables not working while routin...

T.O.M. Wrote: (10-20-2020, 01:55 AM) -- You must set `method="post"` in your form. If it is not set, then form sends data with GET. And you are trying to get data from POST - $this->request->getPos...
2,280 Views
4 Replies
10-21-2020, 04:24 PM
mlurie
    Thread: Form-Action Variables not working while routing
Post: RE: Form-Action Variables not working while routin...

You need to add your form submit button before form_close() PHP Code: -- echo form_open('/action_route'); echo form_input('input_name', 'input_value'); echo form_submit('submit_name', 'submit_va...
2,280 Views
4 Replies
10-19-2020, 05:49 PM
mlurie

Theme © iAndrew 2016 - Forum software by © MyBB