Welcome Guest, Not a member yet? Register   Sign In
URGENT!! Please Help and save my butt!!! Could someone fix this for me PLEASE???
#1

[eluser]Zong[/eluser]
I was changing the layout of the Forum:http://biofastallergyfree.com/index.php/forums/
Then when I tried to add a new topic, I got this Error message:

MySQL ERROR:

Error Number: 1062

Description: Duplicate entry '0' for key 1

Query: INSERT INTO `exp_forum_topics` (`title`, `body`, `sticky`, `status`, `announcement`, `poll`, `parse_smileys`, `topic_id`, `author_id`, `ip_address`, `forum_id`, `last_post_date`, `last_post_author_id`, `thread_total`, `topic_date`, `board_id`) VALUES ('test', 'test', 'n', 'o', 'n', 'n', 'y', '', '1', '203.45.111.227', '2', '1247049602', '1', '1', '1247049602', '1')


Attached is my data base structure:

Could anyone help me with this Please? It will so much appreciated!!!
#2

[eluser]Thorpe Obazee[/eluser]
Try to get your topic_id be auto_increment assuming it's the Primary key
#3

[eluser]umefarooq[/eluser]
or create a id column and make it primary key and auto_increment.
#4

[eluser]Rick Jolly[/eluser]
As bargainph mentioned, autoincrement "topic_id" as it is the primary key. You are using phpmyadmin, so on the "topic_id" row click the pen icon to edit it. Select the autoincrement option of the "Extra" drop-down and save.

Edit: and remove "topic_id" from your insert statement, unless you want to manually set the topic id to a unique value for every insert. In that case, ignore what I wrote about autoincrement.
#5

[eluser]Zong[/eluser]
[quote author="bargainph" date="1247055822"]Try to get your topic_id be auto_increment assuming it's the Primary key[/quote]
Your solution worked!!!
Thank you so so much!!!
#6

[eluser]Zong[/eluser]
[quote author="umefarooq" date="1247056719"]or create a id column and make it primary key and auto_increment.[/quote]
Problem solved. Thank you very much for your helpSmile
#7

[eluser]Zong[/eluser]
[quote author="Rick Jolly" date="1247057928"]As bargainph mentioned, autoincrement "topic_id" as it is the primary key. You are using phpmyadmin, so on the "topic_id" row click the pen icon to edit it. Select the autoincrement option of the "Extra" drop-down and save.

Edit: and remove "topic_id" from your insert statement, unless you want to manually set the topic id to a unique value for every insert. In that case, ignore what I wrote about autoincrement.[/quote]

Thank you very much for your detailed instruction!!!
I hope it will be helpful for other people who met my problem.
#8

[eluser]Zong[/eluser]
Thank you Guys for saving my butt!

All the best wishesSmile




Theme © iAndrew 2016 - Forum software by © MyBB