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

2011-05-18 13:02:45 +08:00
 ooof
出错消息:

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']),

......

}
3593 次点击
所在节点    PHP
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/13189

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX