- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
or-6ren">
我有问题
$proveedores = ORM::for_table('proveedor')->where_like('nombreproveedor',"%{$namesearch}%")->order_by_asc('nieproveedor')->find_many();
我想保存id。我意识到:
$_SESSION['idproveedor'] = $proveedores['id'];
我的表结构是:
I get the following error in slim
Type: ErrorException
Code: 8
Message: Undefined index: id
错误得到它
$_SESSION['idproveedor']=$proveedores['id'];
var_dump($proveedores);die() 输出为:
array (size=2)
0 =>
array (size=9)
'id' => string '1' (length=1)
'nieproveedor' => string '11111111' (length=8)
'nombreproveedor' => string 'Agrar Semillas S.A' (length=18)
'direccion' => string 'Route de Saint Sever
' (length=23)
'telefono' => string ' 976470646' (length=10)
'ciudad' => string '' (length=0)
'region' => null
'pais' => null
'codpostal' => null
1 =>
array (size=9)
'id' => string '2' (length=1)
'nieproveedor' => string '22222222' (length=8)
'nombreproveedor' => string 'Agrosa Semillas Selectas, S.A.' (length=30)
'direccion' => string 'ddddsfwwffwwwwwwffwfw' (length=21)
'telefono' => string ' 949 305226' (length=11)
'ciudad' => string '' (length=0)
'region' => null
'pais' => null
'codpostal' => null
最佳答案
根据您的 var dump $proveedores
是一个包含 2 个元素的数组,代表您表中的 2 行。您发出的查询似乎返回了 2 行,因此要访问它们,您应该执行如下操作
$id1 = $proveedores[0]['id'];
$id2 = $proveedores[1]['id'];
关于php - 消息 : Undefined index: id,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27617071/
我只是有一个更琐碎的问题。 为什么undefined == undefined 返回true,而undefined >= undefined 为false? undefined 等于 undefine
用PHP 7.2编写套接字服务器。根据Firefox 60中的“网络”选项卡,服务器的一些HTTP响应的第一行随机变为undefined undefined undefined。因此,我尝试记录套接字
在 JavaScript 中这是真的: undefined == undefined 但这是错误的: undefined <= undefined 起初我以为<=运算符包含第一个,但我猜它试图将其转换
在回答这个问题 (Difference between [Object, Object] and Array(2)) 时,我在 JavaScript 数组中遇到了一些我以前不知道的东西(具有讽刺意味的
来自https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/of , Note: thi
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
当我添加 到我的 PrimeFaces Mobile 页面,然后我在服务器日志中收到以下警告 WARNING: JSF1064: Unable to find or serve resource, u
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我是一名优秀的程序员,十分优秀!