1

下面提到的代码在 5.3.17 上运行良好,我有 php 5.3.27,问题是我必须让这段代码在 5.3.27 上运行

链接到完整代码: http: //www.videobluemoon.com/secure/add.txt

$customer_id = (int)$_REQUEST['customer_id'];

if($customer_id  => 0 ) {
           $query = $query.','.$_REQUEST['customer_id'];
   } else {
           die('cust id: '. $_REQUEST['customer_id']);
           die('Please use your browser\'s back button to ensure you have selected a customer');
   }

   if($customer_id => 0 ) {
           $query = $query.', '.$_REQUEST['sysuser_id'];
   else
           die ('There was a problem with the system user');
4

3 回答 3

6

没有类似的东西=>

如果你想检查大于等于使用>=

if ( $customer_id  >= 0 ){

and for 小于等于 use >= and ==is for 等于 等于

检查这个比较运算符¶

于 2013-09-22T07:40:30.400 回答
1

使用==代替=>

=>用于访问数组的键值对,而==用于比较操作。

<?php
$customer_id = (int)$_REQUEST['customer_id'];

if ( $customer_id  == 0 ){
$query = $query . ',' . $_REQUEST['customer_id'] . "";
}else{
die( 'cust id: ' . $_REQUEST['customer_id']);
die ( 'Please use your browser\'s back button to ensure you have selected a customer' );
}

if ( $customer_id  > 0 ){
$query = $query . ', ' . $_REQUEST['sysuser_id'] .  "";
}
else
{
die ( 'There was a problem with the system user' );
}
于 2013-09-22T07:39:52.757 回答
0

=>应该是>=,但你的代码看起来像

    $customer_id = (int)$_REQUEST['customer_id'];

        if ( $customer_id  == 0 ){
                   $query = $query . ',' . $_REQUEST['customer_id'] . "";
           }else{
                   die( 'cust id: ' . $_REQUEST['customer_id']);
                   die ( 'Please use your browser\'s back button to ensure you have selected a customer' );
           }

           if ( $customer_id  > 0 ){
                   $query = $query . ', ' . $_REQUEST['sysuser_id'] .  "";
           } else {
                   die ( 'There was a problem with the system user' );
           }
于 2013-09-22T07:40:25.847 回答