Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/244.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何选择最大值(updateTag)_Php_Mysql_Passbook_Mysql Select Db - Fatal编程技术网

Php 如何选择最大值(updateTag)

Php 如何选择最大值(updateTag),php,mysql,passbook,mysql-select-db,Php,Mysql,Passbook,Mysql Select Db,我使用updateTag列创建digiCardPass,该列是时间戳。 我尝试: 但我无法在php_error.log中获取此错误: [03-May-2013 12:46:06亚洲/金边]PHP公告:格式不规范 在中遇到的数值 /Applications/MAMP/htdocs/passesWebserver/createPass/index.php联机 42[03-May-2013 12:46:06亚洲/金边]最大更新日期: 如何解决这个问题 看看$row1['updateTag'],因为PH

我使用updateTag列创建digiCardPass,该列是时间戳。 我尝试:

但我无法在php_error.log中获取此错误:

[03-May-2013 12:46:06亚洲/金边]PHP公告:格式不规范 在中遇到的数值 /Applications/MAMP/htdocs/passesWebserver/createPass/index.php联机 42[03-May-2013 12:46:06亚洲/金边]最大更新日期:


如何解决这个问题

看看$row1['updateTag'],因为PHP可能无法将其格式化为数字

echo $row1['updateTag'];
echo floatval($row1['updateTag']);

确保updateTag是一个数字。

您的错误日志语句不正确,导致出现错误消息。文本和要写入日志的变量之间有一个逗号,因此它将
$updateTag
作为error\u log命令的第二个参数

error_log("max updateTag:",1,$updateTag); // second var is type 0-3

Optional. Specifies the error log type. 
Possible log types:
0 - Default. The error is sent to the servers logging system or a file, depending on how the error_log configuration is set in the php.ini file
1 - The error is sent by email to the address in the destination parameter. This message type is the only one that uses the headers parameter
2 - The error is sent through the PHP debugging connection. This option is only available in PHP 3
3 - The error is added to the file destination string
尝试:


要消除警告并将
$updateTag
的内容写入日志

中,您是否尝试回显
$updateTag
?我刚刚编辑了我的问题,你可以看一下!是的,谢谢!但在那之后,什么也看不出来!我得把它修好!你是说你在日志中看到了
max updateTag:
,还是什么都没有?若什么都并没有,那个么检查这个代码嵌套的任何条件是否为真。是的,我可以看到,但当我使用这个updateTag在其他查询中选择时,我无法得到结果!您如何使用它作为其他查询?我使用where条件。这是查询:从digiCardPass中选择passTypeID、authenticationToken作为auth、auxiliaryFieldsPowerBy作为aux、associatedStoreIdentifiers作为asso、altTextBarcode作为alt,其中updateTag='$updateTag'
$updateTag
不包含文件名,因此不是有效的目标参数。其目的似乎是将变量内容回显到日志中,并且您的代码将使用$updateTag变量内容的名称将“max updateTag:”写入文件名。
echo $row1['updateTag'];
echo floatval($row1['updateTag']);
error_log("max updateTag:",1,$updateTag); // second var is type 0-3

Optional. Specifies the error log type. 
Possible log types:
0 - Default. The error is sent to the servers logging system or a file, depending on how the error_log configuration is set in the php.ini file
1 - The error is sent by email to the address in the destination parameter. This message type is the only one that uses the headers parameter
2 - The error is sent through the PHP debugging connection. This option is only available in PHP 3
3 - The error is added to the file destination string
error_log("max updateTag: " . $updateTag, 0);