aspergian_mutant wrote:
LoL, yes I know, but if I made it more like actual code then most others would not understand it.
Sorry what I meant is you don't need that code, you don't filter the data once it has been retrieved. You just need to retrieve the users parameters either stored or through other inputs then retrieve the relevant data for that user.
Technically you can do it do it in a single SQL statement. However it so happens that the performance is better using two+.
That is the beauty of relational databases, there is little need for that logic that you put. Standard SQL does have operators but it works a bit differently from 'normal' code, although many versions of SQL are extended enabling it to behave in similar ways to 'normal' code. But in this case that is not necessary.
So the code that you need is database related and to make sure the parameters are transfered from the result of first statement (stored user parameters), plus any custom parameters to the next statement (data matching the parameters ), making sure it is valid and safe. Then to output the results in the desired format/template.
This is purely in relation to viewing matched personal ads. The entire application would be much more than that.
php is the scripting language. It is quite scrappy but it just about works.