phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpgroupware-developers] sitemgr - one more


From: Dave Hall
Subject: Re: [Phpgroupware-developers] sitemgr - one more
Date: Tue, 28 Jan 2003 21:54:31 +1100

Sigurd Nes <address@hidden> wrote:

> It seems like 'block_id' should be altered from 'auto' to 'int' in 
> tablephpgw_sitemgr_content_lang since the block_id is inserted by 
> the query.

hmmmm, I know there are a few phpgw apps that do this. But it is my
understanding that auto_increment fields should not be assigned values
on insert, as the auto increment should deal with it.  These will be
time consuming to track down, but in the interest of good code they
should be found and fixed.  Yes, I am aware that I am looking down from
an ivory tower, but I think it should be done.

While I am on the topic of bad insert scripts.  Some apps (and at least
one api class) use "SELECT MAX(id) FROM table;" after the insert to get
the last insert id.  This is also a no no.  The db abstraction class
supports last insert id, and this should be used instead.  If two users
insert around the same time as each other they may both receive the same
value, and the problems start from there.  Another observation from the
ivory tower, yes it does involve a bit more code, but prevents stuff ups.

Yours awaiting the flames/corrections,

Dave
> 
> Also : there are some more instances of 'addslashes($something)' that
> should have been replaced by
> $this->db->db_addslashes($something) 
> 
> Regards
> 
> Sigurd
> 
> 
> 
> 
> 
> _______________________________________________
> Phpgroupware-developers mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/phpgroupware-developers
> 

Attachment: dave.hall.vcf
Description: Card for <dave.hall@mbox.com.au>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]