phpgroupware-tracker
[Top][All Lists]
Advanced

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

[Phpgroupware-tracker] [Bug #3374] Bad SQL and relation usage


From: nobody
Subject: [Phpgroupware-tracker] [Bug #3374] Bad SQL and relation usage
Date: Tue, 29 Apr 2003 05:06:03 -0400

=================== BUG #3374: FULL BUG SNAPSHOT ===================
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=3374&group_id=509

Submitted by: powerstat               Project: phpGroupWare                 
Submitted on: Tue 04/29/2003 at 11:06
Category:  registration               Bug Group:  devel cvs                 
Severity:  5 - Major                  Priority:  Normal                     
Resolution:  None                     Assigned to:  None                    
Status:  Open                         Component Version:  None              
Platform Version:  None               Reproducibility:  None                

Summary:  Bad SQL and relation usage

Original Submission:  The SQL statement I found here is wrong - because in SQL 

phpgw_addressbook.lid='*$account_lid*'

is not what you want - correct it must be:

phpgw_addressbook.lid like '%$account_lid%'

last but not least referencing two tables in this way is absolutly evil! 
primary and foreign keys should always
be of the same type without a pattern matching!

                        $GLOBALS['phpgw']->db->query("select * from 
phpgw_accounts, phpgw_addressbook where account_lid='$account_lid' and 
phpgw_addressbook.lid='*$account_lid*'",__LINE__,__FILE__);
./registration/inc/class.soreg.inc.php




No Followups Have Been Posted


CC list is empty


No files currently attached


For detailed info, follow this link:
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=3374&group_id=509




reply via email to

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