草庐IT

expection

全部标签

php - "Type error: Too few arguments to function App\Http\Controllers\UserController::attendance(), 0 passed and exactly 1 expected"

我的数据库中有两个表,分别是用户表和出勤表。我现在想做的是根据用户在与他们的个人资料相关联的出勤View中显示数据库中的出勤数据。这是我在userController中的考勤功能。publicfunctionattendance($id){$user=UserProfile::findOrFail($id);$this->authorize('modifyUser',$user);returnview('user.attendance',['user'=>$user]);}这是我到出勤View的路径。Route::get('/attendance/',['as'=>'user.atte

php - 给出警告 : mysqli_free_result() expects parameter 1 to be mysqli_result, bool 值

这个问题在这里已经有了答案:Whattodowithmysqliproblems?Errorslikemysqli_fetch_array():Argument#1mustbeoftypemysqli_resultandsuch(1个回答)INSERTqueryproduces"Warning:mysqli_num_rows()expectsparameter1tobemysqli_result,booleangiven"(3个答案)关闭2年前。为什么我会收到此错误消息:Warning:mysqli_free_result()expectsparameter1tobemysqli_re

php - stream_socket_enable_crypto() : Peer certificate CN =`cs723.mojohost.com' did not match expected CN =`smtp.sendgrid.net'

我们正在尝试向新成员(member)发送自动回复邮件。我们在同一台服务器上的其他站点上使用相同的配置,没有问题。发送电子邮件后,返回以下错误:stream_socket_enable_crypto():PeercertificateCN=cs723.mojohost.comdidnotmatchexpectedCN=smtp.sendgrid.nethttps://gyazo.com/ffb0cb7645d51ed21ecc863f1e3196b2我们使用Laravel连接到:smtp.sendgrid.net网站端口-587使用TLS加密我们尝试了以下但没有成功:端口选项25和252

PHP 警告 : mysqli_close() expects parameter 1 to be mysqli

我正在尝试通过php连接到sql数据库,但一直收到我无法弄清楚的错误。我可以毫无错误地连接到另一个调试脚本。我获得连接并提取数据,但最后出现错误。$con=mysqli_connect("localhost","username","password","dbname");//Checkconnectionif(mysqli_connect_errno()){echo"FailedtoconnecttoMySQL:".mysqli_connect_error();}//ThisSQLstatementselectsALLfromthetable'Locations'$sql="SELE

php - "Expected response code 250 but got code "554 ", with message "554 5.2.0 STOR EDRV“

我想发送一封带附件的电子邮件。使用smtp.office365.com生产环境:ubuntusmtp.office365.com-Laravel5.预期响应代码250但得到代码“554”,消息“5545.2.0STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied;由于消息无法提交消息的永久异常而无法处理消息。本地主机:预期响应代码250但得到代码“530”,消息“5305.7.57SMTP;客户端未通过身份验证,无法在MAILFROM[xxxxxx.xxxx.PROD.OUTLOOK.

php - 警告 : date() expects parameter 2 to be long, 中给出的字符串

我在我的数据库的car_detail.php页面上不断收到这个错误Warning:date()expectsparameter2tobelong,stringgivenin/home/speedycm/public_html/speedyautos/cars_class.phponline228*cars_class.php在第228行读取这个$this->expiry_date=date("m/d/Y",$rows['expiry_date']);我该如何解决这个问题? 最佳答案 date()需要一个unix时间戳...我想您正在

php - 给出警告 : mysql_result() expects parameter 1 to be resource, bool 值

我知道我们已经有很多关于这个错误的问题,但我无法修复我的代码,所以这里的任何人都请帮助我解决这个问题。我的代码是这样的functionlogin($username,$password){$user_id=user_id_from_username($username);$username=sanitize($username);$password=md5($password);return(mysql_result(mysql_query("SELECTCOUNT(`user_id`)FROM`users`WHERE`username`='$username'AND`password

php - Symfony2 : transformationFailure "Compound forms expect an array or NULL on submission."

我有一个由6个字段组成的Location对象。其中一些字段是可选的。所以我有一个LocationSelectType,它根据位置、PRE_SET_DATA和PRE_SUBMIT事件填充字段。这工作正常。但是在PRE_SUBMIT上,我还想根据用户输入的数据创建Location对象。这似乎可行,但最后会触发错误:*transformationFailure“复合形式在提交时需要一个数组或NULL。”*classLocationSelectTypeextendsAbstractType{public$em;private$router;private$options;publicfunct

php - Symfony 选择类型数组错误 : Unable to transform value for property path: Expected an array

为什么将此表单选项设置为多个时会出现错误。这直接来自Symfonys网站。我只更改了变量名。$builder->add('genre','choice',array('choices'=>array('x'=>'x','y'=>'y','z'=>'z',),'multiple'=>true,));这是错误:Unabletotransformvalueforpropertypath"genre":Expectedanarray.这是我的这个变量的实体类:/***@varstring**@ORM\Column(name="genre",type="text",nullable=true)*

PHPUnit 测试一个带有 expects() 方法的类

问题是我正在模拟的依赖项有一个expects()方法。这个类依赖于我正在测试的类。设置()方法$this->test=$this->getMockBuilder(Request::class)->disableOriginalConstructor()->getMock();所以当我写我的测试时$this->test->expects($this->once())->method('otherMethod')->willReturn(0);这会报错:CannotredeclareMock_Test_f21c25ee::expects()in...我该如何解决这个问题?编辑:在我使用se