bastien wrote:try
$sql="select * from tablename WHERE q34 = 'Multiple Sources' AND q39 = 'Job Available' AND (q17 LIKE '%$searchpcode%' OR q19 LIKE '%$searchpcode%') ORDER BY `id` DESC ";
}
Hi
I don't think I explained my problem correctly...
Thanks for the response, but this will not work because $searchpostcode is the input from the FORM...
What I need is the above SQL AND another that searches for q19 from the FIRST SQL result of whatever is in q19.
So... here I try to explain more clearly in the hope someone can help me...
My First search I enter m32 in to the FORM and it gives me this result.
Job ID | Type | Pick Up | Deliver.
JOB : 1244 |2 -3 Day Service |M32 0RY | MK42 7QH
Now I type MK in to the FORM and it gives me this result..
Job ID | Type | Pick Up | Deliver.
JOB : 1253 |Same Day Service | mk1 | sn1
JOB : 1244 |2 -3 Day Service |M32 0RY | MK42 7QH
Notice job 1244 is also included in this result because it has MK in one of the poscodes.
What I want it to do via a DIFFRENT search INPUT FORM is this..
I type M32 in to the DIFFERENT search FORM and it gives me this result...
JOB : 1244 |2 -3 Day Service |M32 0RY | MK42 7QH
JOB : 1253 |Same Day Service | mk1 | sn1
It would produce this result BECAUSE, from the START my search was M32, it found a PICK UP in M32 and displays it, but I am delivering TO MK42, so it now searches the other available jobs to see if anything can be PICKED UP from the MK postcode, so it finds job 1253 is PICKING UP in MK and displays this job.
IF it also found a Pick Up in SN then it would ALSO display this job too!!
Because after I deliver to MK, I pick up in MK, then drive to SN.
So I start my day picking up in M32, delivering to MK43, then picking up in MK1 and delivering to SN1.
If there was a job picking up in SN, it would pull this job and display it aswell and so on until no more matches were found.
Hard to get your head around, and even harder for me to code 😕
Hope this explaines it more clearly 😃