phpgroupware-developers
[Top][All Lists]
Advanced

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

[Phpgroupware-developers] db (was class.acl + mysql)


From: Dave Hall
Subject: [Phpgroupware-developers] db (was class.acl + mysql)
Date: Sat, 15 Apr 2006 09:44:06 +1000

Hi all,

The like is fine.  

Just make it a public property of the db class:

'SELECT field FROM tbl '
        . " WHERE other_field {$db->like} .'%" $db->db_addslashes($val) . "%'";

I think we can make mysql 4 the minimum requirement for HEAD or else we
will always be being held back by old versions.  The current version of
mysql is 5.0.20 with 5.1 in beta.

Also for many left joins, I think the syntax is messy and not as clear
to read as just using a simple WHERE tbl1.tbl_id = tbl2.tbl1_id  Maybe
that is just me.

While we are on the topic of the db.  All apps tables should be prefixed
with phpgw_ to avoid conflicts for people using shared hosting with a
single db.  I know property has been exempted from this, but ged and hrm
should comply with the requirement imho.

Cheers

Dave


On Fri, 2006-04-14 at 23:10 +0200, Sigurd Nes wrote:
> How about putting something like this (from 'property') some central
> place in the api?
> 
> if ($GLOBALS['phpgw_info']['server']['db_type']=='pgsql')
> {
>    $this->join = "JOIN";
>    $this->like = "ILIKE";
> }
> else
> {
>    $this->join = "INNER JOIN";
>    $this->like = "LIKE";
> }
> 
> Regards
> 
> Sigurd
> 
> 
> aeb wrote:
> > On Thu, 13 Apr 2006, Chris Weiss wrote:
> > 
> >> mysql is picky, that should be LEFT JOIN or INNER JOIN or even LEFT
> >> INNER JOIN, for some reason mysql doens't assume LEFT INNER like other
> >> rdbms do
> > 
> > yes, it works with left join in mysql, but not in psql. i got that prob in
> > projects years ago and ended up switching the sql statement for
> > mysql -> left join /postgres -> join
> > 
> >> On 4/13/06, aeb <address@hidden> wrote:
> >>> hey,
> >>>
> >>> phpgw head - acl:
> >>> the join statement (attached file) doesn't work with mysql 3.23.55.
> >>> whats the smallest mysql version phpgw supports?
> >>>
> 
> 
> 
> 
> _______________________________________________
> Phpgroupware-developers mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/phpgroupware-developers
-- 
Dave Hall
Dave Hall Consulting
+-------------------------------------+-------------------------------+
| p +61 3 9754 5276                   | m +61 410 47 42 55            |
| f +61 3 8610 0029                   | e address@hidden       |
| j address@hidden                 | aim skwashd                   |
| icq 278064022                       | msn address@hidden       |
| sip address@hidden       | y! skwashd                    |
+-------------------------------------+-------------------------------+





reply via email to

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