The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem with update function
#25
I am going to go through and document this better but...

Many of the methods in the DB class do not fully process the query by default. I tried to make them, but that breaks other things in the system as posted above.

When you see a method like...
Code:
public function get($table, $where){
<pre>
Code:
        return $this->action('SELECT *', $table, $where);
<code></code>    }
</pre>


The method is actually really flexible because you can tell it what you want to do with it.

So you can append
Code:
->first()
to get the first result back
Code:
->count()
to get a count of the results
Code:
->results()
to get ALL the results
Code:
->lastId()
to find out the last highest number id associated with that query (GREAT for when you insert something into the db and you need to know what id was automatically created by that query so you can immediately use it.

Again, more documentation is coming, but things like
Code:
findById
and
Code:
get
are designed to be used in conjunction with other methods in the db class.
  Reply


Messages In This Thread
problem with update function - by lefox - 05-22-2016, 05:55 AM
problem with update function - by mudmin - 05-22-2016, 04:02 PM
problem with update function - by lefox - 05-22-2016, 04:40 PM
problem with update function - by mudmin - 05-22-2016, 04:42 PM
problem with update function - by lefox - 05-22-2016, 05:26 PM
problem with update function - by mudmin - 05-22-2016, 05:37 PM
problem with update function - by lefox - 05-22-2016, 05:58 PM
problem with update function - by lefox - 05-22-2016, 05:59 PM
problem with update function - by mudmin - 05-22-2016, 06:54 PM
problem with update function - by lefox - 05-22-2016, 07:28 PM
problem with update function - by mudmin - 05-22-2016, 07:43 PM
problem with update function - by lefox - 05-22-2016, 08:22 PM
problem with update function - by lefox - 05-22-2016, 08:29 PM
problem with update function - by mudmin - 05-22-2016, 08:34 PM
problem with update function - by lefox - 05-22-2016, 09:06 PM
problem with update function - by mudmin - 05-22-2016, 09:34 PM
problem with update function - by mudmin - 05-22-2016, 09:45 PM
problem with update function - by mudmin - 05-22-2016, 10:23 PM
problem with update function - by mudmin - 05-22-2016, 11:01 PM
problem with update function - by lefox - 05-23-2016, 06:42 PM
problem with update function - by mudmin - 05-23-2016, 07:02 PM
problem with update function - by lefox - 05-23-2016, 07:17 PM
problem with update function - by mudmin - 05-23-2016, 07:42 PM
problem with update function - by brian - 05-23-2016, 08:04 PM
problem with update function - by mudmin - 05-27-2016, 01:33 PM

Forum Jump:


Users browsing this thread: 4 Guest(s)