개발하면서 db쪽 에러를 보고싶습니다
본문
config.php에서
define('G5_DISPLAY_SQL_ERROR', TRUE); 로 설정을 했습니다
그다음 적용이 안되서 디버거로 한줄씩 타는데
function sql_query($sql, $error=G5_DISPLAY_SQL_ERROR, $link=null){...}에서
G5_DISPLAY_SQL_ERROR는 분명히 true인데
$error에 true가 할당이 안되더라구요 이게 뭔일이죠..? php 7.4 사용중입니다
답변 1
lib/common.lib.php에서
function sql_query($sql, $error=G5_DISPLAY_SQL_ERROR, $link=null)
{
...
if(function_exists('mysqli_query') && G5_MYSQLI_USE) {
if ($error) {
$result = @mysqli_query($link, $sql) or die("<p>$sql<p>" . mysqli_errno($link) . " : " . mysqli_error($link) . "<p>error file : {$_SERVER['SCRIPT_NAME']}");
} else {
$result = @mysqli_query($link, $sql);
}
} else {
if ($error) {
$result = @mysql_query($sql, $link) or die("<p>$sql<p>" . mysql_errno() . " : " . mysql_error() . "<p>error file : {$_SERVER['SCRIPT_NAME']}");
} else {
$result = @mysql_query($sql, $link);
}
}
위 코드로 보아 문제 없어 보입니다.
가끔 <script, <select 등등 특이한 태그 안에서 sql 실행시 브라우저에서는 안 보이고
소스 보기"로 해서 보이는 경우가 있습니다.