[英]php function works in localhost but doesn't on the server
When I try to put my website in production, i get an error, but everything works well in my wamp localhost. 当我尝试将网站投入生产时,出现错误,但是在我的wamp localhost中一切正常。
The error => 错误=>
Le line 20 is the last of this code portion => 第20行是此代码部分的最后一个=>
$user = $o_utilisateur->getUserByLogPass($log, $pass);
if(isset($user['0'])){
//GET group BY user
$tmp = $o_droit->getGroupById($user['0']['TB_groupe_id_groupe']);
$user['0']['libele'] = $tmp['0']['libele'];
I might be the PHP version ? 我可能是PHP版本吗?
You checked isset($user['0'])
, but not isset($tmp['0'])
. 您检查了
isset($user['0'])
,但没有检查isset($tmp['0'])
。 The problem must be with the $tmp
variable, it has no 0
key. 问题必须出在
$tmp
变量上,它没有0
键。
if(isset($user['0']) && isset($tmp['0']))
I don't know what $tmp
is supposed to contain, but for some reason it doesn't contain it on your production server. 我不知道
$tmp
应该包含什么,但是由于某种原因,它在您的生产服务器上不包含它。 You need to check whatever code creates the $tmp
array, perhaps it's a database problem, did you upload the DB to production? 您需要检查创建
$tmp
数组的任何代码,也许这是数据库问题,您是否已将数据库上传到生产环境?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.