Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Pondelok, 30. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  How to get auto increment to work

phpMyEdit Configuration     How to get auto increment to work
Odoslať novú tému   Odpovedať na tému    
 
cwright     Založený: 15.09.2008   Príspevky: 5  
Príspevok Zaslal: 2008-09-15 18:34
Návrat hore  Odpovedať s citátom     

My code is:

$opts['fdd']['id'] = array(
'name' => 'id',
'select' => 'T',
'options' => 'AVCPDR', // auto increment
'maxlen' => 11,
'sort' => true

My id field ranges from 1 to 1056 and is an integer type. I can add one record which gets assigned an id of 0. After that I cannot add records and am getting an MySQL error 1062 Duplicate entry '0' for key 1. It keeps wanting to use 0 for the id.

How can I get the auto incrementing to work. Where is the code to add 1 to the id field or do I need to get into triggers to make this happen.

Thanks

 
cwright     Založený: 15.09.2008   Príspevky: 5  
Príspevok Zaslal: 2008-09-15 19:02
Návrat hore  Odpovedať s citátom     

If you can't tell from my post, I'm new to phpmyedit and mysql.

The problem was not with phpMyEidt but rather simply the configuration of my table. The id field needed to be set to "Auto increment".
I fixed it using phpMyAdmin and making my id field "auto increment" under the "extra" setting. The SQL was an alter table command:
ALTER TABLE `tablename` CHANGE `id` `id` INT( 11 ) NOT NULL AUTO_INCREMENT

Maybe this will help someone else out.

Thanks all.

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov