| 
	
 | 
 Posted by NC on 06/15/89 11:43 
sicapitan@gmail.com wrote: 
> 
> I have two tables: 
> 
> Table "record": 
> id, record_id, data1, data2 
> 
> Table "subrecord": 
> id, record_id, name, value 
 
How, if at all, are they cross-indexed? 
 
> In the subrecord the name contains the header title, and the value the 
> value.  I need to: 
> 
> 1.  Search the database 
> 
> (`name` = 'firstname' AND `value` LIKE %'somevalue%') AND 
> (`name` = 'emailaddress') AND `value` LIKE '%somevalue%') 
 
This is syntactically incorrect; the number of opening parentheses does 
not match the number of closing parentheses.  So I really have no idea 
what you are trying to do. 
 
Also, am I correct thinking that 'firstname', 'emailaddress', and 
'%somevalue%' are all user inputs? 
 
Right now, there are too many blanks to give you a precise answer; the 
only thing I can tell you is that you should look into SQL joins.  You 
should join the two tables on the field they have in common. 
 
Cheers,  
NC
 
[Back to original message] 
 |