提问人:Madisson 提问时间:1/6/2023 最后编辑:Your Common SenseMadisson 更新时间:1/6/2023 访问量:73
如何在 SQL 注入的 POV 中使用 where as 函数和 select 函数 [已关闭]
How to use where as function and select function in POV of SQL Injection [closed]
问:
由于我必须多次获取数据,所以我创建了选择函数,它在哪里是函数的写入方式,而且从SQL注入的角度来看,这种方式不好吗?请指导
function where($column, $value) {
return "AND $column = :$column";
}
function fetchCategory($where, $data1) {
// Create a PDO instance
$db = Database::newInstance();
// Build the SELECT statement with a WHERE clause
$sql1 = "SELECT * FROM category WHERE 1=1 $where";
// Execute the SELECT statement with bound parameters
$row1 = $db->read($sql1, $data1);
// Return the result set
return $row1;
}
$where = where('cat_id', $value->parent_id);
$data1 = array(':cat_id' => $value->parent_id);
$result = fetchCategory($where, $data1);
if ($result) {
// Fetch the data from the result set
$data['Dis_05']= $result[0]->category;
} else {
// No data was found
echo "No data found";
}
答: 暂无答案
评论
where
read()