How can I use the PHP program to implement conditional filtering similar to 58 through the PHP program? which of the following statements can be achieved through the stupid method, however, it is too time-consuming and there are more redundant code. I don't know which expert can offer a better solution. thank you!
Reply to discussion (solution)
Why is there no one?
What is a stupid method?
This requirement can be achieved by splicing filtering conditions, for example, when no conditions exist.
select * from tbl_name where 1=1
If you select a region, the SQL statement becomes
select * from tbl_name where 1=1 and area = ”XXX“
After selecting a method, the SQL statement becomes
select * from tbl_name where 1=1 and area = ”XXX“ and type=1
Multiple conditions are always placed after the SQL statement.
You can consider passing parameters through the URL, or directly writing a cookie or session, and then assembling an SQL statement for the existing data. I think so, but it depends on the requirements.
Few people answered.
No one. Which of the following heroes can help you? thank you.
In fact, this problem is very big, and both the server and client are involved.
The server mainly generates query statements.
How does the client determine the value passing style?
However, if you do not have any specific requirements, why can't you write a book?
Ajax or Frame click to submit once
Like this?
Then you can combine and assemble SQL statements.
In fact, this problem is very big, and both the server and client are involved.
The server mainly generates query statements.
How does the client determine the value passing style?
However, if you do not have any specific requirements, why can't you write a book?
I have already written it out, but now it's mainly about data splitting. you can check it at www.0971my.com/wskh.php?
We strongly recommend that you have php + sphinx
I used to get one. you just need to change it.
// Delete the GET parameter if (isset ($ _ GET ['AC']) {$ k = substr ($ _ GET ['AC'], 3 ); unset ($ _ GET ['AC']); if ($ k = 'all') $ _ GET = array (); else unset ($ _ GET [$ k]);}/* 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 the SQL statement.