Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > MISCELLANEOUS > Archives > Bug Report 1.4.x

Post Reply
 
Thread Tools
  #1  
Old 06-26-2005, 05:28 AM
luminist Offline
forum loafer
 
Join Date: Jun 2005
Posts: 3
AUTO_INCREMENT for image ID numbers?

Is there a reason that's escaping me why mysql_insert_id() is being used to assign the image ID for new posts, instead of counting the number of existing images and incrementing by one?

Since mysql_insert_id() retrieves the ID generated for the AUTO_INCREMENT column by the previous INSERT query, if images are ever deleted and later re-added (or not) it causes quirky jumps/gaps in the image ID.

I realize this is being extremely picky, but it seems that something like the following would work just as well:

$photonumb = sql_array("select count(*) as count from ".$pixelpost_db_prefix."pixelpost");
$theid = $photonumb['count'] + 1;
Reply With Quote
  #2  
Old 06-26-2005, 06:54 AM
Connie
Guest
 
Posts: n/a
Luminist:

yes there is a reason: It was done like this.
You know, you have almost everytime more than one choice, even in programming..

but seriously: Punk who created PixelPost, used this function and not the other.

But what is the problem for you: IDs are IDs and not inventary-numbers..
they work for functionality, for counting you have other tools

or do you see any problems in it?
Reply With Quote
  #3  
Old 06-26-2005, 10:16 AM
Joe[y]'s Avatar
Joe[y]+ Offline
Team Pixelpost
 
Join Date: Mar 2005
Location: UK
Posts: 3,101
Send a message via MSN to Joe[y]
if this small aesthetical problem is more important than functionailty to users then this is useful otherewise steer clear.
Reply With Quote
  #4  
Old 06-26-2005, 02:56 PM
luminist Offline
forum loafer
 
Join Date: Jun 2005
Posts: 3
As Joey said, it's purely aesthetic. I didn't mean to suggest that the current implementation is a bad one (quite the contrary, I'm thrilled with the application), I was more curious as to whether there was an inherent benefit that wasn't obvious to me from using auto_increment.

Thanks!
Reply With Quote
  #5  
Old 06-26-2005, 05:39 PM
raminia's Avatar
raminia+ Offline
Team Pixelpost
 
Join Date: Jan 2005
Location: FL, US
Posts: 3,706
Send a message via Yahoo to raminia
I prefer not to answer the over asked question about the image id.

8)
__________________
Photoblog: http://pblog.raminia.com Powered by Pixelpost 1.7
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 06:58 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs