小编Cat*_*Can的帖子

Codeigniter 向课程添加多个类别(Academy-LMS)

我正在使用Academy LMS源代码在Github 中, 它是一个学习管理系统,旨在为每个课程设置一个类别

我想为一门课程添加多个类别

/controllers/API.php我有

  // Fetch all the categories
  public function categories_get($category_id = "") {
    $categories = array();
    $categories = $this->api_model->categories_get($category_id);
    $this->set_response($categories, REST_Controller::HTTP_OK);
  }

  // Fetch all the courses belong to a certain category
  public function category_wise_course_get() {
    $category_id = $_GET['category_id'];
    $courses = $this->api_model->category_wise_course_get($category_id);
    $this->set_response($courses, REST_Controller::HTTP_OK);
  }
Run Code Online (Sandbox Code Playgroud)

然后在/models/Api_model.php,我有

// Get categories
public function categories_get($category_id)
{
    if ($category_id != "") {
        $this->db->where('id', $category_id);
    }
    $this->db->where('parent', 0);
    $categories = $this->db->get('category')->result_array();
    foreach ($categories as …
Run Code Online (Sandbox Code Playgroud)

php mysql codeigniter

6
推荐指数
1
解决办法
229
查看次数

使用SQLMap中的凭据直接连接到数据库

我具有TARGET网站数据库和SQLMap 的凭据,可以直接连接到数据库。这是我在Kali Linux上有关SQLMap的命令

sudo sqlmap -d mysql://USER:PASSWORD@TARGET_IP:MySQL_Port/DATABASE
Run Code Online (Sandbox Code Playgroud)

sudo sqlmap -d mysql://admin:12345@95.12.45.12:3306/information_schema
Run Code Online (Sandbox Code Playgroud)

但这是我每次都遇到的错误

[CRITICAL]  SQLAchemy connection issue ('(_mysql_exceptions.OperationalError)
(1045, "Access denied for user 'admin'@'17.45.65.11' (using password: YES)")')
Run Code Online (Sandbox Code Playgroud)

该IP 17.45.65.11是我的IP ofc,拒绝了

那么我的命令有问题吗?

还是有人知道使用凭证直接连接到目标数据库的更好方法?

python mysql sql-injection sqlalchemy sqlmap

1
推荐指数
1
解决办法
2903
查看次数

标签 统计

mysql ×2

codeigniter ×1

php ×1

python ×1

sql-injection ×1

sqlalchemy ×1

sqlmap ×1