어떤 부분에 문제가 있는 건가요? 채택완료
어떤 부분에 문제가 있는 건가요?
DB 에는 값이 있으나, 출력이 되지 않습니다.
shop.lib.php
function get_color1($it_id)
{
global $g5;
$sql = "select count(is_color) as color1 from {$g5['g5_shop_item_use_table']} where it_id = '$it_id' and is_color='6' ";
$row = sql_fetch($sql);
return (int)$row['color1'];
}
item.php
$color1 = get_color1($it['it_id']);
item.form.skin.php
<?php if ($color1) {
echo $color1?>명
<?php } ?>
답변 3개
id값이 나온다면 원인은 쿼리문에 있겠죠
global $g5; 다음줄에 아래 코드를 넣어서 출력이 있는지 보세요
$qq=sql_query("select is_color from {$g5['g5_shop_item_use_table']} where it_id = '$it_id' and is_color='6' ");
while($row = sql_fetch_array($qq)) echo '<br>'.$row[is_color];
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인