Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I am trying to search all possible penpals by gender and country, maybe including the county if it is selected and I wish to select penpals within a date of birth (d1,m1,y1), (d2,m2,y2), if y2<y1 or y2> y1, limiting the first ten correct results.
is the right sql code
[syntax="sql"]select from penpal GENDER='$gender' AND COUNTRY='$country' and COUNTY='$county' or COUNTRY='$country' and
'$m1' <MONTHOFBIRTH and '$y1'=YEAROFBIRTH or '$d1'<DAYOFBIRTH and '$m1' =MONTHOFBIRTH and '$y1'=YEAROFBIRTH or '$d2'>DAYOFBIRTH and '$m2' =MONTHOFBIRTH and '$y2'=YEAROFBIRTH or
'$m2' >MONTHOFBIRTH and '$y2'=YEAROFBIRTH or '$y2' <YEAROFBIRTH and '$y1'>YEAROFBIRTH LIMIT 0,10"feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]