Topic: 求助(谢谢)(prepare SQL select statement from form input)

  Print this page

1.求助(谢谢)(prepare SQL select statement from form input) Copy to clipboard
Posted by: YoYo
Posted on: 2004-08-23 15:45

{ 请尽量用准确的文字描述作为标题
I'll delete the next topic you posted if you keep on using a subject like "求助"
-- why }


三个列表框,一个文本框
<select name="checkCard">
<option value=1 selected >已审核</option>
<option value=0 >未审核</option>
</select>
<select size="1" name="cxtj_fh" option="小于">
<option value="=">等于</option>
<option value="like">包含</option>
</select>
<select size="1" name="cxtj_zd">
<option value="user_name">持卡人姓名</option>
<option value="user_kahao">卡号</option>
<option value="zhece_data">注册日期</option>
</select>
<input name="cxtj_value" type="text" value="">
用4个变量提取出来

请教这样的复杂查询怎么写

2.Re:求助(谢谢) [Re: YoYo] Copy to clipboard
Posted by: chengbd
Posted on: 2004-08-23 16:56

什么查询,问题也没有说明白!

3.Re:求助(谢谢) [Re: YoYo] Copy to clipboard
Posted by: YoYo
Posted on: 2004-08-23 17:33

比如:select * from table where 卡号=123 and shenhe=‘0‘
其中:卡号、=、123都是从表单提取过来的变量

我是这样写的(感觉不对):
if(shenhe=="1"){
sql+="where" +type +fuhao+key+"and" +"shenhe='已审核'";
}else{
sql+="where" +type +fuhao+ key+"and" +"shenhe='未审核'";}


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923