entry id defaulting to zero (0)
entry id defaulting to zero (0)
Currently when someone posts a blog the id value in serendipity_entries defaults to zero and then won't show up. Any help would be much appreciated.
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: entry id defaulting to zero (0)
Hi!
Which s9y version and which database backend? The id should autoincrement. Maybe you imported a SQL dump and forget to export autoincrement keys?
Regards,
Garvin
Which s9y version and which database backend? The id should autoincrement. Maybe you imported a SQL dump and forget to export autoincrement keys?
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: entry id defaulting to zero (0)
Thank you for the response. I'm on version 1.5.2. Any direction would be much appreciated.
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: entry id defaulting to zero (0)
Hi!
I also need your database type... and what about my question about migration?
Regards,
Garvin
I also need your database type... and what about my question about migration?
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: entry id defaulting to zero (0)
I was kind of handed this blog so I'm not sure what happened. I think it was upgraded right before it was passed on to me but I don't know how they did it. The database is phpMyAdmin.
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: entry id defaulting to zero (0)
Hi!
Ideally, you should get someone proficient with MySQL to check your migration path, because obviously whoever executed the migration/upgrade didn't properly do that...
Regards,
Garvin
phpMyAdmin is a tool; but surely you mean MySQL. You'll need to check if your serendipity_entries has a autoincrement primary key on the "id" column.ianinc wrote:I was kind of handed this blog so I'm not sure what happened. I think it was upgraded right before it was passed on to me but I don't know how they did it. The database is phpMyAdmin.
Ideally, you should get someone proficient with MySQL to check your migration path, because obviously whoever executed the migration/upgrade didn't properly do that...
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: entry id defaulting to zero (0)
I surely do mean MySQL. I checked the entries column and tried to add the autoincrement primary key but it gave me an error "#1062 - Duplicate entry '26' for key 1". I don't live in an ideal world right now so I need to fix this. Would like any help you could give me. Thanks.
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: entry id defaulting to zero (0)
Hi!ianinc wrote:I surely do mean MySQL. I checked the entries column and tried to add the autoincrement primary key but it gave me an error "#1062 - Duplicate entry '26' for key 1". I don't live in an ideal world right now so I need to fix this. Would like any help you could give me. Thanks.
Adding an autoincrement later is a bit hard; how many entries do you have? I'd edit each row and give it a unique ID, so that after that you can add the autoincrement.
If you have too many entries with the same ID, you would need to export the table as an SQL dump WITHOUT the "id" column, then empty the table, then add the autincrement key and then re-import the SQL dump. But the first method would be better because it involves less points of failures
HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: entry id defaulting to zero (0)
there was only about 30 so I plugged in sequential numbers over that and then I was able to edit the entries column with the primary key autoincrement. Worked like a charm, thanks for the help.