仅在查询中包括选定的字段;动态地 [英] Including only chosen fields in query; Dynamically

查看:51
本文介绍了仅在查询中包括选定的字段;动态地的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个表格形式的文本字段.用户有两个选项:或者在其中输入一些值,或者选择位于它们上方的任何"复选框.然后将这些值传递到搜索页面(PHP).

在搜索页面中,运行SQL查询.现在,这是主要的事情.我希望以某种方式仅将那些输入了值且未选中任何"复选框的字段包含在此查询中.

感谢您的每一份帮助!

谢谢! (即使您不能帮忙)


改进部分:

字段:

Hello all,

I''ve some text fields, in a form. The user has two options : either to enter some value in them or choose "Any" checkbox which is above them. These values are then passed on to the search page (PHP).

In the search page, an SQL query is run. Now, here''s the main thing. I want some way that only those fields where values are entered, and "Any" checkbox is not checked, to be included in this query.

Every piece of help appreciated!

Thanks! (Even if you cannot help)


Improved part:

The fields:

$id = $_POST['ID'];
$type = $_POST['type'];
$subtype = $_POST['ht'];
$frmarea = $_POST['frmarea'];
$toarea = $_POST['toarea'];
$unit = $_POST['units'];
$frmprice = $_POST['fromprice'];
$toprice = $_POST['toprice'];
$currency = $_POST['currency'];
$frmbeds = $_POST['frmbeds'];
$tobeds = $_POST['tobeds'];
$frmbaths = $_POST['frmbaths'];
$tobaths = $_POST['tobaths'];



不幸的是,我没想到要怎么做:(
可以帮忙吗?



Unfortunately, I could not think of an idea how to do it :(
Can help?

推荐答案

id =
id =


_POST [' ID'];
_POST['ID'];


类型 =
type =


这篇关于仅在查询中包括选定的字段;动态地的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆