草庐IT

undefined-index

全部标签

PHP 错误 : Function name must be a string/Undefined Variable send_sms

if(!empty($_GET['new_time'])){$sql2="SELECT*FROM".$table_name."WHEREid=".$_GET['new_time'];$result2=mysqli_query($conn,$sql2);$rows=mysqli_fetch_assoc($result2);$mobile_number=$rows['mobile_number'];//Createinstancewithkey$key='AIzaSyD1tPfs4s2dYYHMkCOqNZoVsTkDyud-9Yg';$googer=newGoogleURLAPI($ke

php - Cpdf.php 行 3855 : Undefined index: at barryvdh/laravel-dompdf 中的 ErrorException

我使用的是laravel5.2,dompdf在本地主机上运行良好,但是当移动到AWS时,它一直显示ErrorExceptioninCpdf.phpline3855:Undefinedindex:,在这一行(3855)中有字体变量。示例代码:$html="Hello";PDF::setOptions(['dpi'=>150,'defaultFont'=>'sans-serif']);$pdf=PDF::loadHTML($html)->setPaper('a4','landscape');return$pdf->download('pdfview.pdf');由于barryvdh/lar

php - laravel 5 - 我如何添加 ->index() 到现有的外键

框架:Laravel5.2数据库:MySQLPHP:7.0我有“pops”表:Schema::create('pops',function(Blueprint$table){$table->string('id')->primary()->index();$table->string('ab_test_parent_id')->nullable();$table->string('cloned_parent_id')->nullable();$table->timestamps();});还有“转化”表:Schema::create('conversions',function(Blu

php - undefined variable 。拉维

我正在尝试过滤我的结果。为此,我有以下查询:$destinations=$request['destinations'];if($request->has('destinations')){$trips=Trip::where('status','=',1)->whereHas('destinations',function($q){$q->where('destinationsid','=',$destinations);})->get();}else{echo"Nodestinationprovided";}但是我得到了undefinedvariable$destinations。

php - undefined variable 当值为空时

我有2个代码块....//第一个区block$val){echo$name.":".$val[0].",".$val[1].",".$val[2];}}unset($new_array);?>第二block$val){echo$name.":".$val[0].",".$val[1].",".$val[2];}}unset($new_array);?>第一block或第二block将在一天内给出空结果。意味着如果今天,第一个block将给出空结果,明天第二个block将给出空结果......或者......问题:今天,第二个block的值是空的,它给出了通知:undefinedvari

php - 如何用数组 [INDEX] 元素替换 {tag_INDEX}

我有这样的字符串;"String{tag_0}text{tag_2}and{tag_1}"现在我需要用数组中的元素替换所有{tag_INDEX}$myArray=array('a','b','c');所以替换后它应该是这样的:"Stringatextcandb"最好的方法是什么?我正在尝试使用preg_replace和preg_replace_callback但没有任何好的结果 最佳答案 $newStr=preg_replace('/{tag_(\d+)}/e','$myArray[\1]',$str);

php - 引用数组键时为 "Undefined index"

我在index.php中有一个表单';echo'echo?>这里$row['act_name']是从数据库中获取的值。我的update_act.php文件是但我收到错误Undefinedindex:$row['act_name']inC:\wamp\www\ps\activity\update_act.php。我想为不同的submits使用不同的名称,但我无法在另一个页面中获取它的值。有什么办法吗? 最佳答案 我不完全知道你想做什么,但是如果变量$row['act_name']的值在两种情况下(表单页面和更新脚本)都相同,那么你可以

PHP 不会对 undefined variable 发出警告

如有错误请指正。据我所知,PHP应该对此发出警告,但实际上没有。我正在使用PHP5.2.17。我怎样才能解决这个问题?我假设这是在php.ini中的某处设置的? 最佳答案 查看errorreporting的文档.我相信如果您启用E_NOTICE,您会看到针对undefinedvariable的警告。您可以阅读所有错误报告常量here. 关于PHP不会对undefinedvariable发出警告,我们在StackOverflow上找到一个类似的问题: https

php - 在 PHP 中执行存储过程后调用 odbc_fetch_array 给出错误 [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index

因此,我尝试使用ODBC在SQL数据库中执行存储过程,但它返回错误odbc_fetch_array()[function.odbc-fetch-array]:SQLerror:[Microsoft][ODBCSQLServerDriver]InvalidDescriptorIndex,SQLstateS1002inSQLGetData这是PHP部分,非常标准...$id=240$user="user";$password="password";$server="server";$database="database";$con=odbc_connect("SERVER=$server;

PHP: "Call to undefined method"... 但方法已定义?

我有一个Database.php类,它是一个抽象的Singleton类:其他数据库扩展了这个类并实现了抽象函数,这样我就可以改变我使用的数据库,同时确保我的应用程序仍然可以工作,只要它使用这个抽象层中的函数(我已经省略了函数定义来自上面的代码)。我在PDO.php中有一个PDO类。它扩展了数据库,还包括与上面相同的instance()函数,但它没有自己的$_instance变量。classPDOextendsDatabase{//...publicstaticfunctioninstance(){$class=get_called_class();if(!self::$_instanc