使用> =和

时间:2021-09-05 01:01:54

I want to update certain fields in a database table and i'm trying to use the <= and >= It gives back an error.

我想更新数据库表中的某些字段,我正在尝试使用<=和> =它会返回错误。

This is my query

这是我的疑问

 $update_kooi = "UPDATE tbl_inschrijvingen 
                 SET tbl_inschrijvingen.KMid = '".$keurmeester."'
                 WHERE (((tbl_inschrijvingen.Kooinummer) >= '".$kooi1."' 
                       OR <= '".$kooi2."'))";

It must update those fields which are between to posted values.

它必须更新发布值之间的那些字段。

Can somebody help me?

有人能帮助我吗?

Thnax

3 个解决方案

#1


0  

You can use 'Between' like

你可以使用'Between'之类的

UPDATE tbl_inschrijvingen 
SET tbl_inschrijvingen.KMid = '".$keurmeester."'
WHERE (((tbl_inschrijvingen.Kooinummer) 
    between '".$kooi1."' and  '".$kooi2."'))"

#2


0  

Make your query look simple there are too many ( ) making it very confusing

让你的查询看起来很简单,有太多()使它非常混乱

$update_kooi = 
"UPDATE tbl_inschrijvingen 
SET tbl_inschrijvingen.KMid = '".$keurmeester."'
WHERE 
( tbl_inschrijvingen.Kooinummer >= '".$kooi1."' OR tbl_inschrijvingen.Kooinummer <= '".$kooi2."')";

You were trying as

你是在尝试

(
 ( 
   ( col) >= 'some val' or <= 'someval' 
 )
)

Which is not the correct way.

这不是正确的方法。

You can also use between as

您也可以在之间使用

where col between va1 AND va2

#3


0  

$update_kooi = "UPDATE tbl_inschrijvingen SET tbl_inschrijvingen.KMid = $keurmeester
            WHERE (tbl_inschrijvingen.Kooinummer BETWEEN $kooi1 AND $kooi2)";

#1


0  

You can use 'Between' like

你可以使用'Between'之类的

UPDATE tbl_inschrijvingen 
SET tbl_inschrijvingen.KMid = '".$keurmeester."'
WHERE (((tbl_inschrijvingen.Kooinummer) 
    between '".$kooi1."' and  '".$kooi2."'))"

#2


0  

Make your query look simple there are too many ( ) making it very confusing

让你的查询看起来很简单,有太多()使它非常混乱

$update_kooi = 
"UPDATE tbl_inschrijvingen 
SET tbl_inschrijvingen.KMid = '".$keurmeester."'
WHERE 
( tbl_inschrijvingen.Kooinummer >= '".$kooi1."' OR tbl_inschrijvingen.Kooinummer <= '".$kooi2."')";

You were trying as

你是在尝试

(
 ( 
   ( col) >= 'some val' or <= 'someval' 
 )
)

Which is not the correct way.

这不是正确的方法。

You can also use between as

您也可以在之间使用

where col between va1 AND va2

#3


0  

$update_kooi = "UPDATE tbl_inschrijvingen SET tbl_inschrijvingen.KMid = $keurmeester
            WHERE (tbl_inschrijvingen.Kooinummer BETWEEN $kooi1 AND $kooi2)";