Вопрос по – Проверка ограничения внешнего ключа Codeigniter

4

Error: User Rate Limit Exceeded

+-----------+--------------+------+-----+---------+----------------+
| Field     | Type         | Null | Key | Default | Extra          |
+-----------+--------------+------+-----+---------+----------------+
| id        | int(11)      | NO   | PRI | NULL    | auto_increment |
| firstname | varchar(255) | NO   |     | NULL    |                |
| name      | varchar(255) | NO   |     | NULL    |                |
+-----------+--------------+------+-----+---------+----------------+

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

public function delete_user($id) {
    return $this->db->delete('users', array('id' => $id));
}

Error: User Rate Limit Exceeded

Error Number: 1451

Cannot delete or update a parent row: a foreign key constraint fails (`testing`.`users_link`, CONSTRAINT `users_link_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`))

DELETE FROM `users` WHERE `id` = '1'

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded Satya
Error: User Rate Limit Exceeded EsTeGe

Ваш Ответ

1   ответ
8

$db['default']['db_debug']

if ($this->db->_error_number() == 1451)

Error: User Rate Limit Exceeded$errors = $this->db->error();
Error: User Rate Limit Exceeded$db['default']['db_debug']Error: User Rate Limit Exceeded/application/config/database.phpError: User Rate Limit Exceeded

Похожие вопросы