【发布时间】:2017-08-13 17:00:05
【问题描述】:
有人可以指导我如何将“pk”的mysql 行的值提取到$response 变量,以便能够允许脚本自动取消关注用户。我已经尝试过该脚本,并且在提供 pk id 时它会取消关注,但我想自动从 mysql 获取它以便能够运行它。感谢您提供的任何帮助。
这些是我尝试过的方法,但没有成功:
$this->db->select('pk');
$this->model->from(INSTAGRAM_FOLLOW_TB);
$this->db->where("id = '11'");
$query1 = $this->db->get();
$result = $query1->result();
仅取消关注此 ID 的主 ID-由 Mushfik Media 创建,
$response = $i->unfollow($result);
我也试过
$accounts = $this->model->fetch("*", INSTAGRAM_ACCOUNT_TB, "id = '11'");
$response = $i->unfollow($accounts->pk);
但是没有用。 $NEED MYSQL DATA VALUE 是应该回显该值但不回显的位置
case 'unfollow':
try {
$result = $i->getSelfUsersFollowing();
if(!empty($result) && $result->status == "ok" && !empty($result->users)){
$response = $i->unfollow($NEED MYSQL DATA VALUE);
$response = $response->status;
$CI =& get_instance();
$CI->load->model('Schedule_model', 'schedule_model');
$lang = $CI->db->insert(INSTAGRAM_FOLLOW_TB, array(
"pk" => $row->pk,
"name" => $row->username,
"type" => $data->schedule_type,
"uid" => $data->uid,
"account_id" => $data->account,
"account_name" => $data->name,
"created" => NOW
));
}
} catch (Exception $e){
$response = $e->getMessage();
}
break;
【问题讨论】:
标签: php mysql codeigniter instagram-api