[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
Betr.: [ic] Mysql - autoincrement primary number
Hi,
Maybe this SQL statment helps....
CREATE TABLE grp
(grp_id INTEGER default NULL AUTO_INCREMENT,
grp_omschr CHARACTER (30) NOT NULL,
grp_datetime TIMESTAMP NOT NULL,
PRIMARY KEY (grp_id));
Met vriendelijke groet,
Jan van Dijk
j.vandijk@attema.nl
B.V. Kunststoffenindustrie Attema
tel : 0183-650650 tst 674
fax: 0183-650751
>>> alma@youramigo.com 13-3-02 5:18:48 >>>
Thanks Jonathan for your response.
> I am trying to set mysql db table, and I want primary key to be
> autincremented every time when I add new record to db table.
>Don't set the field in your form. Setting an auto increment field
causes
>your value to be used instead. For the increment to work, the field
should
>be null.
I remove it from form and then I got following message in error log:
"No key 'my_id' found for function='insert' table='mydb'
I tried to to do following:
<INPUT TYPE="hidden" NAME="my_id" VALUE="">
same thing is happening, I tried following:
<INPUT TYPE="hidden" NAME="my_id" VALUE="NULL">
Then there is no errors in my log file but only thing that gets saved
to
db is my_id everything else is ignored.
Here is part of my form:
[set mv_data_enable]1[/set]
[tag flag write]mydb[/tag]
<FORM ACTION="[process]" METHOD="POST">
<INPUT TYPE=HIDDEN NAME="mv_data_table" VALUE="mydb">
<INPUT TYPE=HIDDEN NAME="mv_data_key" VALUE="my_id">
<INPUT TYPE=HIDDEN NAME="mv_data_function" VALUE="insert">
<INPUT TYPE=HIDDEN NAME="mv_nextpage" VALUE=@@MV_PAGE@@>
<INPUT TYPE=hidden NAME=mv_check VALUE=NewWeb>
<INPUT TYPE="HIDDEN" NAME="mv_data_fields" VALUE="my_id,
............">
<<<<<<Other fileds go in here >>>>>>>>>>
<INPUT TYPE=hidden NAME="mv_todo" VALUE="set">
<INPUT TYPE="SUBMIT" VALUE="Send Info">
_______________________________________________
interchange-users mailing list
interchange-users@interchange.redhat.com
http://interchange.redhat.com/mailman/listinfo/interchange-users