close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

auto incremental numbers

Thread began 10/06/2010 10:50 am by i.edwards384429 | Last modified 10/06/2010 1:23 pm by i.edwards384429 | 669 views | 5 replies |

i.edwards384429

auto incremental numbers

Hi

I've created a database following the tutorial setting the first field a ID and makeing that auto incremental and the primary key.


I now want another field to be called product_ref to be auto incremetal and start at 5000

so I set the field name

set it to integar set it to auto increment

set the default to 5000

However when I select save I get the error

"incorrect definition there can only be one auto colum and it must be defined as a key"

where have I gone wrong

thanks

Ian

Sign in to reply to this post

Jason ByrnesWebAssist

This is a limitation to MySQL

Only one column in the database can be set to Auto Increment. MySQL will not allow you to have 2 Auto Increment columns.

Sign in to reply to this post

Willi Schneider

Originally Said By: i.edwards384429
  "incorrect definition there can only be one auto colum and it must be defined as a key"  



Hi

The answer is in the error message "there can only be one auto column"

Although I think, I know what you are trying to achieve, there is no workaround for DataAssist at the moment, at least I'm not aware of any. I hope DA3 will cover such a feature.
Interakt had this in their "MX Kollection" "Nextensio" lists and forms. The solution was to run a "transaction" right before creating a new database entry, which added an "auto-increment" value to a second column.
Take a look here for a detailed explanation:
041136_setordercolumn.htm

Sign in to reply to this post

i.edwards384429

update

thanks for the assist

Ian

Sign in to reply to this post

Dave BuchholzBeta Tester

Ian,

you can set the initial value to increment from when setting up your table like so:

DROP TABLE IF EXISTS `tablename`;
CREATE TABLE IF NOT EXISTS `tablename` (
fields go here
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5000 ;
Sign in to reply to this post

i.edwards384429

update

Thanks Dave

I'll have a look tomorrow

Ian

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...