私のワードプレスのインストールには、大量のデータを保存するテーブルがあります。テーブルでクエリを実行し、適切にフィルター処理された行の選択を返すことができるphpファイルがあります。ユーザーが mysql クエリ変数に対応するさまざまな値を選択できるフォームが自分のワードプレス ページにあります。フォームで選択した値を使用するようにphpファイルを取得するにはどうすればよいですか?
私のフォームは以下を使用しています:
<input type="text" name="max_price" />
<input type="text" name="loan_fraction" />
<input type="text" name="interest_rate" />
<input type="text" list="state" />
どのような種類の送信アクションが必要かはよくわかりませんが、これらの値を次のように使用する php に渡したいと思います。
$values = mysql_query("select
b.listing, b.bed, b.bath, b.type, b.address, b.postcode, b.state, b.price, avg_rent
from
buy_items b
join
(SELECT
bed, bath, type, suburb, postcode, AVG(price) as avg_rent
FROM
rent_items
GROUP BY bed, bath , type , suburb , postcode) a ON a.bed = b.bed and a.bath = b.bath
and a.suburb = b.suburb
and a.postcode = b.postcode
and a.type = b.type
where
(b.price * some_number) < a.avg_rent
and b.price > 50000
and price < max_price
and b.state = state");
ここで、some_number は、loan_fraction と interest_rate の関数です。
ありがとう :)