inc() public méthode

Method generates incremental function call
public inc ( integer $num = 1 ) : array
$num integer increment by int or float. 1 by default
Résultat array
Exemple #1
0
<?php

require_once 'MysqliDb.php';
/* updates voting colums for upvote and downvote */
$pid = $vote = $db = new MysqliDb('localhost', 'root', 'hack123', 'colgpolls');
if ($vote == 'yes') {
    $data = array('upvote' => $db->inc(1));
} else {
    $data = array('downvote' => $db->inc(1));
}
$db->where('pid', $pid);
$db->update('polls', $data);