草庐IT

undefine

全部标签

php - View 中的 Laravel 5 Pagination undefined variable 车辆

我正在尝试使用L5分页,一切看起来都很好,直到我点击第二页链接。当我点击它时出现此错误:Laravel5PaginationundefinedvariablevehiclesinviewControllerpublicfunctionsearch(){$vehicle=Vehicle::with('representive','seller','buyer','whoUpdated')->orderBy('created_at','desc')->first();;$previous=Vehicle::where('id','id)->max('id');$next=Vehicle::

php - 更新 Google 日历 - fatal error : Call to undefined function dateTime()

我正在尝试使用PHPAPI更新Google日历。我已成功创建Google日历事件并自动获取事件ID,但是当我尝试更新事件时,出现此错误:PHPFatalerror:CalltoundefinedfunctiondateTime()inpublic_html/googleapi/calendarupdate.phponline45.它指的是行:$event->setStart.dateTime($startdatetime);这是我当前的错误PHP代码:setAssertionCredentials($credentials);if($client->getAuth()->isAcces

php - 向数组添加新索引而不生成 'undefined index' 警告

我正在遍历一个数组,如果我在数组中发现错误,我会添加一个名为error的键。但是我收到一大堆“未定义索引”错误警告。如何在不产生这些警告的情况下执行此操作?请求的代码$csv=array();if(($handle=fopen($filePath,"r"))!==FALSE){while(($csv[]=fgetcsv($handle))!==FALSE);fclose($handle);}foreach($csvas&$row){if(count($row)>$maxCols)$maxCols=count($row);if(count($row)==0){$errors++;$row

php - 我的 for 语句有什么问题;得到 undefined offset ?

我一直收到undefinedoffset..这会有什么问题?for($m=0;$m 最佳答案 那是因为,添加一个将使您的循环迭代直到数组的不存在索引。,像这样重写。for($i=0;$i我推荐foreach相反。foreach($dataas$k=>$v){} 关于php-我的for语句有什么问题;得到undefinedoffset?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions

PHP/SQLite3 : Fatal error: Call to undefined function sqlite_num_rows()

当我调用函数sqlite_num_rows时出现此错误。它一定不是依赖性问题,因为其他Sqlite函数正在运行。我能够打开连接并从数据库获取数据。 最佳答案 晚了4年,但我遇到了同样的问题,所以这是我为遇到同样问题的任何人提供的解决方案//$dbisthedatabasehandle$result=$db->query("SELECT*FROMtable_name");$rows=0;//setrowcounterto0while($row=$result->fetchArray()){$rows+=1;//+1tothecount

php - undefined variable PHP 类

我正在尝试调试我创建的类。它总是中断并在日志中抛出undefinedvariable我找不到解决方案因为我不知道我做错了什么,我认为它应该工作但没有。undefined变量在erase()函数中,而不是在show()函数中classpepe{private$array=array();functionshow(){$this->erase();print_r($this->array);}functionerase(){print_r($this->array);}}$o=newpepe();$s=$o->show(); 最佳答案

PHP 通知 : Undefined index

我正在使用Zendeskphpclass,下面的函数用于删除附件。/***Deleteoneormoreattachmentsbytokenorid*$paramsmustincludeoneofthese:*'token'-thetokengiventoyouaftertheoriginalupload*'id'-theidoftheattachment**@paramarray$params**@throwsMissingParametersException*@throwsResponseException*@throws\Exception**@returnbool*/publ

php - undefined offset PHP 错误,试图从文件中读取

我收到“undefinedoffset”PHP错误,但不知道是什么原因导致的。我只是一个初学者。Notice:Undefinedoffset:3online58这是我使用的代码:$file=fopen("portfolio.file","r")ordie("Unabletoopenaportfoliofile.");$portfolioFull=fread($file,filesize("portfolio.file"));fclose($file);$portfolioItems=explode(";",$portfolioFull);$i=count($portfolioItems

php - Laravel 5.2 curl_init() 抛出错误 "Call to undefined function"

我正在尝试使用curl在laravel中使用FCM,但出现错误。首先,我在我的一个Controller中编写了一个php代码:$first_name=$request->input('first_name');//FCMapiURL$url='https://fcm.googleapis.com/fcm/send';//api_keyavailableinFirebaseConsole->ProjectSettings->CLOUDMESSAGING->Serverkey$server_key='AIzaSyA1RyuAGGPASh_flFCwiyd9ZHEMYlhQOho';$tar

php - Laravel "Call to undefined method"仅在生产中发生

我有2个Controller函数,它们调用位于应用程序文件夹下的类的静态函数。Controller\UserResController.phppublicfunctionshow($id,Request$request){return\App\User::show($id,$request);}Conrtollers\Other\UserResController.phppublicfunctionshow($id,Request$request){//othercodesreturn\App\User::show($id,$request);}应用\用户.phppublicstati