这是一个创建于 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']),
......
}