Skip to content

Commit

Permalink
Merge pull request vcian#37 from vc-urvin/main
Browse files Browse the repository at this point in the history
Add quotes in SQL query
  • Loading branch information
ruchit288 authored Jan 9, 2024
2 parents 8f742e6 + 0c3f4e3 commit a5822c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Traits/Audit.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ public function getConstraintField(string $tableName, string $input): array
}

if($input === Constant::CONSTRAINT_INDEX_KEY) {
$result = DB::select("SHOW INDEX FROM {$tableName} where Key_name != 'PRIMARY' and Key_name not like '%unique%'");
$result = DB::select("SHOW INDEX FROM `{$tableName}` where Key_name != 'PRIMARY' and Key_name not like '%unique%'");
} else {
$result = DB::select("SHOW KEYS FROM {$tableName} WHERE Key_name LIKE '%" . strtolower($input) . "%'");
$result = DB::select("SHOW KEYS FROM `{$tableName}` WHERE Key_name LIKE '%" . strtolower($input) . "%'");
}


Expand Down

0 comments on commit a5822c9

Please sign in to comment.