채택완료
this will throw an Error in a future version of PHP 포인트 랭킹 부분
Copy
<?php
$sql_common = " and mb_id != '{$config[cf_admin]}' "; //이부분과
$rank_rows = 15; //출력 수
$sql = " select * from {$g5[member_table]} where mb_point > '{$row[mb_point]}' {$sql_common} order by mb_point desc, mb_today_login desc limit {$rank_rows} "; // 이 부분이 문제를 일으킵니다
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
$rank = number_format($i + 1);
//$rank_name = get_sideview($row['mb_id'], $row['mb_nick'], $row['mb_email'], $row['mb_homepage']);
$rank_name = $row['mb_nick'];
$point = number_format($row['mb_point']);
if ($rank == 1) {
$rank_bg = ' rank_bg1';
} else if ($rank == 2) {
$rank_bg = ' rank_bg2';
} else if ($rank == 3) {
$rank_bg = ' rank_bg3';
} else {
$rank_bg = '';
}
?>
<li><span class="rank_bg<?php echo $rank_bg; ?>"><?php echo $rank; ?></span><?php echo $rank_name; ?><span class="rank_point"><?php echo $point; ?></span></li>
<?php } ?>
어떻게 해결해야 할까요?
php 7.2 이상에서 오류를 뱉습니다
|
답변 1개 / 댓글 3개
채택된 답변
+20 포인트
2019-01-20 (일) 01:17:42
this will throw an Error in a future version of PHP
이거 다음의 에러 로그를 보여 주세요. 그래야 진단이 가능합니다.
PHP7.2에서 사용되지 않는 전역 상수를 사용해서 그럴겁니다.
대부분 문자열의 따옴표 때문에 그렇더라구요....ㅠㅠ
답변에 대한 댓글 3개
neko24
2019-01-20 (일) 04:48:29
2019-01-20 (일) 05:02:13
'cf_admin' 그리고 'member_table' 와 'mb_point' 를 이렇게 감싸 보세요.
답변을 작성하려면 로그인이 필요합니다.
Warning: Use of undefined constant member_table - assumed 'member_table' (this will throw an Error in a future version of PHP) in
Warning: Use of undefined constant mb_point - assumed 'mb_point' (this will throw an Error in a future version of PHP) in
이네요