You must Sign In to post a response.
  • Category: HTML

    Auto Id Generation with text in php

    Friends,

    I am developing my site in html with php,mysql. i want to create ID auto increment like this CUS1,CUS2,CUS3....CUS100. How to create auto ID generation in php?
  • #747556
    Hi,

    I don't have knowledge in PHP, so i telling step by step.

    1. First you count records from table (Database)

    2. assign the counting records to local variable (i)

    3. check the variable (i) have value

    4. if i is 0

    string autoincreement = "CUS1";

    5. if the value is greater than zero

    int j=i+1;

    autoincreement = "CUS" + j

    I hope it will help you...

    Thanks and regards
    S.Sursh

    "IF YOU WANT TO SHINE LIKE A SUN FIRST YOU HAVE BURN LIKE IT".


  • Sign In to post your comments