Housing rental network that kind of conditions to filter how to achieve through the PHP program

Source: Internet
Author: User
Similar to 58 this conditional filtering through the PHP program how to achieve, who told, through the stupid method can be achieved, but that is too time-consuming and redundant code more, do not know which master can have a better way, thank you!


Reply to discussion (solution)

Why no one?

What is the method of the stupid method?

This requirement, splicing the filter conditions can be achieved, such as without any conditions



If you select an area, the SQL statement becomes



When you choose a method, the SQL statement becomes



A variety of conditions have been spelled out after the SQL statement.

You can consider URL parameters, or consider writing directly to a cookie or session, and then assemble SQL for the existing data. I think so, but it depends on the demand.

It seems that there are very few answers.

Still no one, which heroes help, thank you

In fact, the problem is very large, the server and the client are involved in the
How the server is primarily generating query statements
How the client determines the style of the value passed
And you do not say any specific requirements, and then people add you a book?

Ajax or Frame click submit Once

A form like this?
Then you can assemble SQL

In fact, the problem is very large, the server and the client are involved in the
How the server is primarily generating query statements
How the client determines the style of the value passed
And you do not say any specific requirements, and then people add you a book?


Landlord, Concrete I have already written out, now is mainly data splitting, can go to www.0971my.com/wskh.php above look

Highly recommended Php+sphinx you deserve to have

I've had one before, so you can see for yourself.

Remove the GET parameter if (isset ($_get[' act ')) {  $k = substr ($_get[' act '], 3);  unset ($_get[' act ');  if ($k = = ' All ') $_get = Array ();  else unset ($_get[$k]);} /* Get get parameter */function GetParam ($k) {  $param = $_get;  if (Isset ($_get[$k])) unset ($param [$k]);  $param [$k] = ';  Return Http_build_query ($param);}

This $param usage, '. $quyu [' title ']. '
The rest is to spell the SQL statement.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.