select * from forms_data_recs
where fdr_form_id='37' and ( fdr_ff_id ='190' and ( fdr_value like
'%keith%' ))
OR ( fdr_ff_id = '192' and (fdr_value like '%public%' ))
order by fdr_date,fdr_id



-----Original Message-----
From: Keith Clay [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 09, 2002 12:42 PM
To: [EMAIL PROTECTED]
Subject: select problem


Here is my table on which I am doing sql query:

+--------+------------------+-------------+-----------+---------------------
-+---------------------+
| fdr_id | fdr_uid          | fdr_form_id | fdr_ff_id | fdr_value
       | fdr_date            |
+--------+------------------+-------------+-----------+---------------------
-+---------------------+
|     63 | Fmct560CMs9m8m6K |          37 |       193 | goodbye
       | 2002-07-08 11:44:35 |
|     62 | Fmct560CMs9m8m6K |          37 |       192 | Clay
       | 2002-07-08 11:44:35 |
|     61 | Fmct560CMs9m8m6K |          37 |       191 | A
       | 2002-07-08 11:44:35 |
|     60 | Fmct560CMs9m8m6K |          37 |       190 | Keith
       | 2002-07-08 11:44:35 |
|     64 | Fmct560CMs9m8m6K |          37 |       194 | test01
       | 2002-07-08 11:44:35 |
|     65 | Jowl587FHe3m4y8U |          37 |       190 | John
       | 2002-07-08 11:45:10 |
|     66 | Jowl587FHe3m4y8U |          37 |       191 | Q
       | 2002-07-08 11:45:10 |
|     67 | Jowl587FHe3m4y8U |          37 |       192 | Public
       | 2002-07-08 11:45:10 |
|     68 | Jowl587FHe3m4y8U |          37 |       193 | hello
       | 2002-07-08 11:45:10 |
|     69 | Jowl587FHe3m4y8U |          37 |       194 | test02 test03
test04 | 2002-07-08 11:45:10 |
|     70 | Nfal733ELh6y6z1M |          37 |       190 | Keith
       | 2002-07-09 11:56:24 |
|     71 | Nfal733ELh6y6z1M |          37 |       191 | G
       | 2002-07-09 11:56:24 |
|     72 | Nfal733ELh6y6z1M |          37 |       192 | Public
       | 2002-07-09 11:56:24 |
|     73 | Nfal733ELh6y6z1M |          37 |       193 | hello
       | 2002-07-09 11:56:24 |
|     74 | Nfal733ELh6y6z1M |          37 |       194 | yes
       | 2002-07-09 11:56:24 |
+--------+------------------+-------------+-----------+---------------------
-+---------------------+

This is the output of a submitted form so that anything with the same
fdr_uid is from the same submitted form and every thing with fdr_form_id
the same is from the form( there are multiple submitted forms for each
form which is basically the template) and fdr_ff_id is the question on
the form.  I am trying to search for entries on fdr_form_id='37' and I
want entries where fdr_ff_id='190' and contains keith and
fdr_ff_id='192' and contains public.  This select is dynamically generated.

select * from forms_data_recs where fdr_form_id='37' and ( fdr_ff_id =
'190' and ( fdr_value like '%keith%' )) and ( fdr_ff_id = '192' and (
fdr_value like '%public%' )) order by fdr_date,fdr_id

I get no records.  What am I doing wrong if anything?  What can I do to
get the select to work?

keith
--
-------------------------------------------------
Keith Clay, [EMAIL PROTECTED]
Lead Programmer, Web Integration and Programming
286 Adams Center for Teaching Excellence
Abilene Christian University
Abilene, TX 79699
(915) 674-2187
(915) 674-2834
-------------------------------------------------


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to