我如何在MySQL数据库上运行FB ID的检查,&;其他个人数据,因此在重新访问时只显示某个页面


How can i run a check on a MySQL database for a FB ID, & other personal data so only a certain page is shown when revisiting?

我创建了一个Facebook应用程序,我只需要人们输入一次数据。

这一切都在起作用,数据库也在填充中,但我需要确保人们不会没完没了地回来重新输入他们的数据。

检查用户是否已经提交数据的最佳方法是什么?

signed_request可能仍然已经提交,并且他们的数据没有输入,所以我需要检查两者是否有效。

理想情况下,PHP只会检查FBID+其他数据,并且只显示一个确认/感谢页面。

目前我要发送到数据库的php是:

class Users_Model extends CI_Model {
    protected $_name = 'users';
    function add($id,$key,$value) {
        $data = array(
           'id' => $id,
           'name' => $key,
           'value' => $value
        );
        return $this->db->insert($this->_name, $data); 
    }
    function update($id,$key,$value) {
        $data = array(
           'value' => $value
        );
        $this->db->where(array(
           'id' => $id,
           'name' => $key
        ));
        return $this->db->update($this->_name, $data); 
    }
    function exists($id,$key=null) {
        if($key == null) {
            $this->db->where(array(
            'id' => $id
            ));
        } else {
            $this->db->where(array(
            'id' => $id,
            'name' => $key
            ));  
        }
        $query = $this->db->get($this->_name);
        if($query->num_rows() > 0) {
            return true;
        }
        return false;
    }
    function remove($id) {
        $data = array(
           'id' => $id,
        );
        return $this->db->delete($this->_name, $data); 
    }
    function all() {
        $query = $this->db->get($this->_name);
        $results = array();
        if($query->num_rows() > 0) {
            foreach($query->result() as $row) {
                $results[]=$row;
            }
        } 
        return $results;  
    }
}

非常感谢您的帮助。。。

检查用户是否已经提交数据的最佳方法是什么?

检查您的数据库中是否已经有用户的Facebook id记录。