select * from cp where jg between $a and $b
解决方案 »
- what's strange?
- php 能做什么?
- 向高手求助,求教下面代码哪错了??
- class.csstidy.php 怎么使用?
- 菜鸟--如何区分客户端和服务器端(如何设计)
- 大家帮我解释下这些代码谢谢了!
- 有没有办法让PHP程序在windows服务里运行
- 大家来帮看一个这个网页http://www.searchfans.info/search/abs/1-1.html都不是*.PHP的文件它到低是怎么运行的呢,真是想不明白~
- 我想建个网站,用php语言,我想问在linux下可以运行dreamweaver吗?如果不可以 的话大家都怎么建网站的?不好意思,我是菜鸟
- php的mysql_list_db调用,怎么能返回数据库名?
- 连接数据库(,mysql)
- 如何传送一定字节的数据
然后用 select * form cp where jg='$a' or jg='$b'
能具体点吗?
explode????
$a=$arr[0];
$b=$arr[1];
$newstring=explode("-",$oldstring);
$a=$newstring[0];
$b=$newstring[1];
if ($a>($a+$b)/2)
{ max=$a;
min=$b;
}
else{
min=$b;
max=$a;
} selecet xxx
from xx
where xx<=max and xx>=min
这样写对不对?
$oldstring="100-200";
$newstring=explode("-",$oldstring);
$a=$newstring[0];
$b=$newstring[1];if ($a>$b){
$sql="selecet xxx from xx where xx<=$a and xx>=$b";
}else if($a==$b){
$sql="selecet xxx from xx where xx='$a'";
}else{
$sql="selecet xxx from xx where xx<=$b and xx>=$a";
}echo $sql;
?>
$oldstring="100-200";
$newstring=explode("-",$oldstring);
$a=$newstring['0'];
$b=$newstring['1'];
$sql="select * from cp where XX='$a' or XX='$b'";//如果是要找他们之间的东东
$sql="select * from cp where XX between $a and $b";