phpgroupware-developers
[Top][All Lists]
Advanced

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

Re: [Phpgroupware-developers] proposal-branch; porting


From: Chris Weiss
Subject: Re: [Phpgroupware-developers] proposal-branch; porting
Date: Thu, 22 Apr 2004 13:18:00 +0000

Joseph Engo (address@hidden) wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> sigurdne wrote:
>
> | How about $GLOBALS['phpgw']->db->db_addslashes()
>
> There are 2 things you can do for this.   If you are getting your
> values from a form, safeargs will take care of adding slashes to it.
> Outside of that, you can just use addslashes() from PHP.  To be
> honest, I can't remeber why we created our own function for handling
> this.  Does anyone remeber ? :P

php has functions for just about every database type for escaping in whatever
special way each needs.  a simple addslashes() won't cut it.

>
> | $GLOBALS['phpgw']->db->get_last_insert_id()
> |
> This is something I need to add.  Its very easy to do for PostgreSQL,
> but MySQL is more of a pain.  For now, I am just doing a select after
> I add the record.  Which will be fixed later once get_last_insert_id()
> is ported.  AdoDB doesn't, from what I understand have something like
> this, or its something they removed over time for whatever reason.


php also has function for getting the last id for each database, and where it
doesn't there's a special SQL command for getting it from the database.  Doing
a select is still error prone, even if you are looking for timestamps and
stuff, and is less than optimal anyway.





reply via email to

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