How To Get Next Auto Increment id of a Table

The code you are using is not exactly getting the next auto-increment value. It’s just getting the biggest ID and increases it by 1.

$cm_query_id_obj = db_fetch_array(db_query(“SHOW TABLE STATUS LIKE ‘civicrm_mailing’ “));
echo $cm_query_id_obj[‘Auto_increment’];

Was this article helpful?

Related Articles