0

Hi friends,

I have a form to create a company details.. which will insert the details into a table.
For this table, I need to have a auto increment field as character..

when we have autoincreament as Integer... whenever the new company is created..the number will increase from 0, 1, 2, 3,..and so on..

I have added a hidden text field in the form and set the value as C1.
I need the values to get auto increament..so when ever the company is created..the value adds on as c1, c2, c3....and so on...
and these values has to be updated in the database also..
I am so lost in this...
I am working with php and mysql...
Your help is much appreciated...

Thanks.
Tryphy

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by bobbymoir
0

You can not insert character in AUTO_INCREMENT. Use AUTO_INCREMENT column to save numeric values but concatenate c with AUTO_INCREMENT value while display the data.

0

Hi friends,

I have a form to create a company details.. which will insert the details into a table.
For this table, I need to have a auto increment field as character..

when we have autoincreament as Integer... whenever the new company is created..the number will increase from 0, 1, 2, 3,..and so on..

I have added a hidden text field in the form and set the value as C1.
I need the values to get auto increament..so when ever the company is created..the value adds on as c1, c2, c3....and so on...
and these values has to be updated in the database also..
I am so lost in this...
I am working with php and mysql...
Your help is much appreciated...

Thanks.
Tryphy

Set the field as Auto increment in the database itself while designing the database. That solves your problem, when you insert any data the field with auto increment will automatically insert its data by increment of 1.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.