The Serendipity Handbook

You can now read the (german) handbook here: PDF - https://github.com/s9y/Book (LaTeX source).

Forum-Information

Before posting about errors, make sure that the answer cannot already be found in our FAQ or by searching this forum!
Posting is restricted to registered users (registering is free and simple!) due to recent spam attacks. When having trouble with this board, contact garvin(-at)s9y(-dot)org.

Board index General discussions entry id defaulting to zero (0)

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
ianinc
Regular
 
Posts: 5
Joined: Tue Nov 23, 2010 7:00 pm

Postby ianinc » Tue Nov 23, 2010 7:04 pm

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.

User avatar
garvinhicking
Core Developer
 
Posts: 28944
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Wed Nov 24, 2010 11:20 pm

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
# 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/

ianinc
Regular
 
Posts: 5
Joined: Tue Nov 23, 2010 7:00 pm

Postby ianinc » Tue Dec 14, 2010 6:12 pm

Thank you for the response. I'm on version 1.5.2. Any direction would be much appreciated.

User avatar
garvinhicking
Core Developer
 
Posts: 28944
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Thu Dec 16, 2010 10:58 am

Hi!

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/

ianinc
Regular
 
Posts: 5
Joined: Tue Nov 23, 2010 7:00 pm

Postby ianinc » Tue Jan 04, 2011 8:56 pm

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.

User avatar
garvinhicking
Core Developer
 
Posts: 28944
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Wed Jan 05, 2011 12:28 am

Hi!

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.


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.

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/

ianinc
Regular
 
Posts: 5
Joined: Tue Nov 23, 2010 7:00 pm

Postby ianinc » Wed Jan 05, 2011 5:01 pm

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.

User avatar
garvinhicking
Core Developer
 
Posts: 28944
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Wed Jan 05, 2011 6:00 pm

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.


Hi!

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/

ianinc
Regular
 
Posts: 5
Joined: Tue Nov 23, 2010 7:00 pm

Postby ianinc » Wed Jan 05, 2011 10:08 pm

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.



Return to General discussions

Who is online

Users browsing this forum: No registered users and 2 guests

cron