小编fic*_*scr的帖子

Cron syntax error near unexpected token

Moved the site to another server. Add file statistic.php to the ?ron to perform. Only this Cron that does not like something. Write errors:

/home/site/www/statistic.php: line 1: ?php: No such file or directory
/home/site/www/statistic.php: line 2: syntax error near unexpected token `"bd.php"'
/home/site/www/statistic.php: line 2: `include ("bd.php");
Run Code Online (Sandbox Code Playgroud)

There is my code

<?php
include ("bd.php");

    $result = mysql_query("SELECT MAX(id) FROM statistic_dep",$db);
    $myrow1 = mysql_fetch_array($result);
    $last_id=$myrow1[0];
...
Run Code Online (Sandbox Code Playgroud)

php cron syntax-error

5
推荐指数
1
解决办法
3898
查看次数

PHP hrtime() 的一致性如何?

我目前正在hrtime()我的一个项目中使用聊天系统(仍处于开发阶段)。

在发送的每条消息中,我将hrtime(true)值与消息一起存储到数据库中。

因此,收件人将根据应用程序 localStorage 中存储的最后一条消息的时间请求新消息。例如: select*from messages_table where message_hrtime>$last_hrtime and message_to=$me

直到今天它一直工作正常,我注意到插入数据库的新消息 hrtime(true)值减少了,这使得新消息无法被接收。

请注意,message_hrtime 列从 id 35 开始减少

请注意,列 message_hrtime 在 id 35 上减少

根据这篇文章 https://thephp.cc/articles/high-resolution-monotonic-timer, hrtime() 不断增加。

现在很困惑是否hrtime(true)一致。

PHP 7.3

php

5
推荐指数
1
解决办法
1834
查看次数

如何使用 lodash 返回匹配模式的属性数组

有没有办法使用该lodash函数返回与模式匹配的属性数组?

_.magicMethod({a:'hi', b:13, c:undefined, d:null, e:null}, null)

return => `['d','e']`
Run Code Online (Sandbox Code Playgroud)

我检查了文档,但什么也没找到:/谢谢。

javascript arrays properties underscore.js lodash

3
推荐指数
1
解决办法
938
查看次数

padStart 有什么替代品

我在 javascript 中使用 padStart 但它不适用于 Internet Explorer 我想知道是否有人知道替代它的替代方法。谢谢

javascript

3
推荐指数
1
解决办法
6084
查看次数

如何在xampp中关闭通知报告?

在远程服务器上没有问题,但在localhost(xampp 3.1.)中,我无法关闭报告通知.

<?php
$Fname = $_POST["Fname"];
...
Run Code Online (Sandbox Code Playgroud)

结果:

Notice: Undefined index: Fname in D:\xampp\htdocs\xx\php01\form01.php on line 6
Run Code Online (Sandbox Code Playgroud)

php.ini中

; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
; Development Value: E_ALL
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
; http://php.net/error-reporting
error_reporting = E_ALL & ~E_NOTICE  //shouldn't this line turn off notice reporting ?
Run Code Online (Sandbox Code Playgroud)

有什么建议吗?

php xampp

1
推荐指数
2
解决办法
3万
查看次数

在一个应用程序中定义两个不同的登录过

我的yii应用程序中的登录过程有问题.我有两种不同类型的用户,包括管理网站和客户的管理员用户.我正在使用CwebUserUserIdentitiy管理这两个组的登录.但我的问题是,当客户登录网站时,他也可以访问管理页面.我想要做的是说应用程序为它们创建两个不同的身份会话.我不想使用访问控制规则之类的东西.有没有办法在Yii风格中为它们创建不同的会话?

php identity login yii

0
推荐指数
1
解决办法
2219
查看次数