auto-increment code in Phalcon

there any way to do auto-increment code Phalcon or performed in the conventional way


if noone replies, can you explain me what auto-increment code is

edited Nov '15

$i = $i + 1; ? or $new_id = $last_id ++; ? If you are working with a MySQL database then you will setup the field e.g. user_id to auto increment. If you need to do it for something else in your code, then just use plain php as above. I do not think there is a specific function in Phalcon to do this.

edited Nov '15

++$new_id; ?

what do you need it for, i dont see a point of a function in any case i can imagine

function increament(&$i){

pfff.. sorry. Tought you were the guy who asked the question. Sorry


ha ha my icon's a slightly different shade of green! :)


I want to autoincrementable a field from the database, a primary code example:

CODE-001 CODE-002 CODE-003 CODE-004