Search Results
Post Author Forum Replies Views Posted [asc]
    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 conn...
mlurie CodeIgniter 4 Support 3 300 04-06-2021, 09:44 AM
    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...
mlurie CodeIgniter 4 Support 7 402 03-27-2021, 07:39 AM
    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: htt...
mlurie CodeIgniter 4 Support 2 500 02-25-2021, 06:01 PM
    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...
mlurie CodeIgniter 4 Support 10 1,748 12-21-2020, 07:13 AM
    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...
mlurie CodeIgniter 4 Support 3 376 12-16-2020, 09:15 PM
    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.
mlurie CodeIgniter 4 Support 3 443 11-09-2020, 02:57 PM
    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/datab...cting-data. PHP Code:$this->builder->select('*, (@no:[email protected]+1)&nb...
mlurie CodeIgniter 4 Support 1 332 11-04-2020, 10:55 AM
    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'...
mlurie CodeIgniter 4 Support 3 443 11-04-2020, 10:45 AM
    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...
mlurie CodeIgniter 4 Support 4 685 10-28-2020, 06:46 PM
    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 ch...
mlurie CodeIgniter 4 Support 4 471 10-28-2020, 06:02 PM
    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.
mlurie CodeIgniter 4 Support 1 387 10-23-2020, 02:06 PM
    Thread: Form-Action Variables not working while routing
Post: RE: Form-Action Variables not working while routin...

(10-20-2020, 01:55 AM)T.O.M. Wrote: 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->g...
mlurie CodeIgniter 4 Support 4 560 10-21-2020, 04:24 PM
    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',&n...
mlurie CodeIgniter 4 Support 4 560 10-19-2020, 05:49 PM
    Thread: required_with Validation Rule works on inserts but not updates
Post: RE: required_with Validation Rule works on inserts...

(10-10-2020, 08:27 PM)mlurie Wrote: I have a form where a select menu is disabled by default.  It's enabled when a when a checkbox is checked and disabled when the checkbox is uncheck using a bit of...
mlurie CodeIgniter 4 Support 1 408 10-11-2020, 03:31 PM
    Thread: Found a Bug with the "set_radio()" function
Post: Found a Bug with the "set_radio()" function

There is a strange bug with the set_radio() function.  I have two sets of radio bullets.  Lets call them $set1 and $set2.  Each set is made up of two radio bullets where the value is either 1 ...
mlurie CodeIgniter 4 Support 0 297 10-11-2020, 12:07 AM
    Thread: Struggling with transaction using multiple models
Post: RE: Struggling with transaction using multiple mod...

(10-09-2020, 10:07 PM)InsiteFX Wrote: Ok, let me know how you make out on this. I like to perform most of my validation at the model level.  It saves a lot of duplicate code and in my opinion better...
mlurie CodeIgniter 4 Support 5 893 10-10-2020, 08:59 PM
    Thread: required_with Validation Rule works on inserts but not updates
Post: required_with Validation Rule works on inserts but...

I have a form where a select menu is disabled by default.  It's enabled when a when a checkbox is checked and disabled when the checkbox is uncheck using a bit of javascript.  I would like this select...
mlurie CodeIgniter 4 Support 1 408 10-10-2020, 08:27 PM
    Thread: Struggling with transaction using multiple models
Post: RE: Struggling with transaction using multiple mod...

I just had a realization... the validation is failing before the insert even occurs. The second insert is never happening. I'm going to have to rethink this...
mlurie CodeIgniter 4 Support 5 893 10-09-2020, 04:56 PM
    Thread: Struggling with transaction using multiple models
Post: RE: Struggling with transaction using multiple mod...

(10-09-2020, 12:05 PM)InsiteFX Wrote: Your calling them wrong. To run your queries using transactions you will use the PHP Code:$this->db->transStart();  and PHP Code:$this->...
mlurie CodeIgniter 4 Support 5 893 10-09-2020, 12:31 PM
    Thread: Struggling with transaction using multiple models
Post: Struggling with transaction using multiple models

I'm struggling with how to get transactions to work when saving with multiple models.  I am developing a Property Management application.  When a single tenant property is created, the data for the pr...
mlurie CodeIgniter 4 Support 5 893 10-09-2020, 08:03 AM

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.