Auto Increment [ai]

eMmm bikin fungsi auto increment sendiri untuk field id via php, curhatnya ntar lagi aja ngantuk mo bo2 dulu ah di mushola ^_^

function id()
{
$sq = “select ifnull(max(id_ticket)+1,’1′) from ticket”;
$qu = mysql_query($sq);
$y = mysql_fetch_array($qu);
$x = $y[0];
return $x;
}

Posted: November 10, 2006

5 Comments »

The URI to TrackBack this entry is: http://irene87.blogsome.com/2006/11/10/107/trackback/

  1. waduh aku gak ngerti nih
    *bingung*

    Comment by iwank — November 10, 2006 @ 6:42 pm

  2. halahhhh bingung aq gak ngerti sama sekaliiii.

    Comment by jimmy — November 11, 2006 @ 4:05 pm

  3. These comments have been invaluable to me as is this whole site. I thank you for your comment.

    Comment by Annerose — June 3, 2007 @ 4:06 pm

  4. very goood

    Comment by fjtpw — June 30, 2007 @ 4:34 pm

  5. Halo,
    gimana kalo input data yang autoincrement juga dengan data yang diinginkan dimulai(misal) ‘data_1001′ sampai ‘data_2000′.
    minta tulung ya mau saya coba langsung pakai perintah mysql saja.

    Comment by abdillah — November 12, 2007 @ 3:17 am

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>