Welcome Guest, Not a member yet? Register   Sign In
Search Results
    Thread: No matching query: return empty key values instead null. Is this possible?
Post: No matching query: return empty key values instead...

Let's take this simple statement: PHP Code: -- $myarray = $this->asArray()->where('id',$id)->first(); -- If it finds a record it will return a collection of key/value pairs. I'd like to know ...
1,892 Views
0 Replies
05-24-2020, 11:14 AM
YanKleber
    Thread: CI4 - Last inserted record id?
Post: RE: CI4 - Last inserted record id?

Thank you all for your collaboration! This worked perfectly to me: PHP Code: -- $this->model->getInsertID(); -- :D
26,269 Views
10 Replies
05-10-2020, 11:56 AM
YanKleber
    Thread: CI4 - Last inserted record id?
Post: RE: CI4 - Last inserted record id?

php_rocs Wrote: (05-08-2020, 05:57 PM) -- @YanKleber, When you add a record what information is unique to the record?  There are multiple ways you can approach this. One way is... - You could creat...
26,269 Views
10 Replies
05-08-2020, 07:25 PM
YanKleber
    Thread: CI4 - Last inserted record id?
Post: CI4 - Last inserted record id?

How to get the id of last inserted record right after to use Model save? I am saving data with: PHP Code: -- $result = $this->model->save($data); -- Thanks!
26,269 Views
10 Replies
05-08-2020, 04:12 PM
YanKleber
    Thread: General use class: static or not?
Post: RE: General use class: static or not?

Cool nicojmb I'll take a look, as well as the docs pointed by php_rocs either! :)
6,680 Views
7 Replies
05-07-2020, 05:57 PM
YanKleber
    Thread: General use class: static or not?
Post: RE: General use class: static or not?

I see... well I am not sweating too much about this... I tested and both methods work without any noticeable difference. I just was imagining if one of them could be considered more "correct". Thanks!...
6,680 Views
7 Replies
05-07-2020, 08:53 AM
YanKleber
    Thread: General use class: static or not?
Post: RE: General use class: static or not?

php_rocs Wrote: (05-06-2020, 02:28 PM) -- @YanKleber, Is this for CI3 or CI4? -- It's CI4. I thought that being basically plain PHP it wouldn't matter, sorry.
6,680 Views
7 Replies
05-06-2020, 02:29 PM
YanKleber
    Thread: General use class: static or not?
Post: General use class: static or not?

I have this generic class with some small functions to be used by the whole application. I would like to know what is considered a 'better practice' in this case: make the methods as static and cal...
6,680 Views
7 Replies
05-06-2020, 02:04 PM
YanKleber
    Thread: Showing popup alerts from DB result?
Post: RE: Showing popup alerts from DB result?

php_rocs Wrote: (05-02-2020, 07:58 AM) -- @YanKleber, Here are several examples of a Bootstrap Admin themes that you can use that has that ability built in. https://getstisla.com/ http://themek...
6,876 Views
6 Replies
05-02-2020, 11:30 AM
YanKleber
    Thread: Showing popup alerts from DB result?
Post: RE: Showing popup alerts from DB result?

muuucho Wrote: (05-01-2020, 04:55 PM) -- Sounds to me like you need ajax which is another concept than just codeigniter and bootstrap's alert functionality. I´ll suggest you start with accepting the...
6,876 Views
6 Replies
05-02-2020, 05:35 AM
YanKleber
    Thread: Showing popup alerts from DB result?
Post: RE: Showing popup alerts from DB result?

I am using Bootstrap 4 directly into the application importing it into the files with . I don't know what is admin theme. PS: I am learning Bootstrap and Codeigniter at the same time...
6,876 Views
6 Replies
05-01-2020, 03:59 PM
YanKleber
    Thread: Showing popup alerts from DB result?
Post: Showing popup alerts from DB result?

I am trying to write a simple CRUD and would like to use alerts (or whatever it is called) to display to the user the result of his actions without have to refresh the page or load a different one wit...
6,876 Views
6 Replies
05-01-2020, 03:24 PM
YanKleber
    Thread: How can I turn the debug bar on?
Post: RE: How can I turn the debug bar on?

Gary Wrote: (04-29-2020, 05:36 PM) -- I'd suggest starting to look in App.php - there is a $baseURL variable spec'd there... and to get it working, perhaps checking $CSPEnabled=false is set (which I ...
19,746 Views
17 Replies
04-30-2020, 04:23 PM
YanKleber
    Thread: How can I turn the debug bar on?
Post: RE: How can I turn the debug bar on?

Gary Wrote: (04-29-2020, 05:36 PM) -- Frustration is a big part of coding. I'd recommend wine, beer or something stronger, as required. -- Haha, SURE! Old timer coder here so I year ya... unfortunat...
19,746 Views
17 Replies
04-30-2020, 07:32 AM
YanKleber
    Thread: How can I turn the debug bar on?
Post: RE: How can I turn the debug bar on?

Sorry, I stayed away for a while studying CI and was a bit frustrated with the debug bar thing. Today I made some tests and figured a couple things. I realized that the debugger is throwing the fol...
19,746 Views
17 Replies
04-29-2020, 03:22 PM
YanKleber
    Thread: DB: question about use of $this
Post: RE: DB: question about use of $this

Okay, I figured what was going on. It was a stupid mistake. The code was alright, but the list of field names in $allowedFields array was with the first letter uppercase. When I wrote down the f...
3,743 Views
4 Replies
04-26-2020, 02:35 PM
YanKleber
    Thread: DB: question about use of $this
Post: RE: DB: question about use of $this

I see now the difference - I didn't realize that Model class have its own methods to handle DB. However, the example you provided to me (that is the same in the documentation) didn't work. Now the ...
3,743 Views
4 Replies
04-26-2020, 11:27 AM
YanKleber
    Thread: DB: question about use of $this
Post: DB: question about use of $this

Hey fellows! Another silly question from a noob...  :P From the CI4 documentation the way of select all from a table is: PHP Code: -- $db = \Config\Database::connect(); $builder = $db->table('...
3,743 Views
4 Replies
04-26-2020, 08:20 AM
YanKleber
    Thread: What's the difference of these two ways of handle DB data?
Post: RE: What's the difference of these two ways of han...

jreklund Wrote: (04-25-2020, 04:44 PM) -- It's because you find CodeIgniter 3 based answers. https://codeigniter.com/userguide3/database/query_builder.html#inserting-data -- Oh, I got it! :blush: ...
2,298 Views
2 Replies
04-25-2020, 04:49 PM
YanKleber
    Thread: What's the difference of these two ways of handle DB data?
Post: What's the difference of these two ways of handle ...

Hi! I have a question about using the methods of query builder. I found everywhere examples that looks like very much to the code below: Code: -- $this->db->insert('ST_ITM', $data); -- Howeve...
2,298 Views
2 Replies
04-25-2020, 04:08 PM
YanKleber

Theme © iAndrew 2016 - Forum software by © MyBB