V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ooof
V2EX  ›  PHP

"Undefined variable: respObj in ... " 错误,求指点。

  •  
  •   ooof · 2011-05-18 13:02:45 +08:00 · 3593 次点击
    这是一个创建于 4965 天前的主题,其中的信息可能已经有所发展或是发生改变。
    出错消息:

    Notice: Undefined variable: respObj in C:\Users\dddd\t2mysql\userinfo.php on line 107

    Call Stack:
    0.0029 364720 1. {main}() C:\Users\dddd\t2mysql\userinfo.php:0

    PHP Notice: Trying to get property of non-object in C:\Users\dddd\t2mysql\userinfo.php on line 107
    PHP Stack trace:
    PHP 1. {main}() C:\Users\dddd\t2mysql\userinfo.php:0

    Notice: Trying to get property of non-object in C:\Users\dddd\t2mysql\userinfo.php on line 107

    Call Stack:
    0.0029 364720 1. {main}() C:\Users\dddd\t2mysql\userinfo.php:0

    PHP Warning: Invalid argument supplied for foreach() in C:\Users\dddd\t2mysql\userinfo.php on line 107
    PHP Stack trace:
    PHP 1. {main}() C:\Users\dddd\twitter2mysql\userinfo.php:0

    Warning: Invalid argument supplied for foreach() in C:\Users\dddd\t2mysql\userinfo.php on line 107

    ========================
    代码如下,前面写 107 的是第107行
    ========================

    //var_dump($respObj->response);

    107 foreach ($respObj->response as $user) {

    //var_dump($user);

    $query = sprintf("REPLACE INTO users SET id = '%s',screen_name = '%s',description = '%s',profile_image_url = '%s',listed_count = '%s',location = '%s',followers_count = '%s',statuses_count = '%s',created_at = '%s',name = '%s'",
    mysql_real_escape_string($user['id_str']),
    mysql_real_escape_string($user['screen_name']),
    mysql_real_escape_string($user['description']),
    mysql_real_escape_string($user['location']),

    ......

    }
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2745 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 13:55 · PVG 21:55 · LAX 05:55 · JFK 08:55
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.