include_once("_common.php");
$sql="SELECT field FROM table";
$result=sql_query($sql);
print_r($result);
이렇게 하면 필드에 있는 값이 출력되는게 아니라
Resource id #21 이런게 출력이 되는데 이거 왜 이런건지 모르겠습니다.
지금 저장되어 있는 값은 test인데,,,,
답변 3개 / 댓글 3개
include_once("_common.php");
$sql = "SELECT field, field2, field3 FROM table";
$row = sql_fetch($sql);
echo $row['field'];
echo $row['field2'];
echo $row['field3'];
$sql = "SELECT field, field2, field3 FROM table";
$result = sql_query($sql);
$row = sql_fetch_array($result);
echo $row['field'];
답변에 대한 댓글 1개
참고하세요
echo $data['field'];
$row = sql_fetch($result);
print_r($row);
답변에 대한 댓글 2개
$res = sql_query($sql);
$data = sql_fetch($res);
echo $data;
이렇게 하면 table의 filed의 값이 나와야 하는데 나오질 않아요. 이게 저만 그런건지 잘 모르겠네요
https://sir.kr/qa/252883
ps. 그누위즈 님 답변 중 sql_query()와 sql_fetch() 설명이 바뀐 듯 합니다.
답변을 작성하려면 로그인이 필요합니다.