-> 현재 DB 에 저장된 데이터를 웹에 끌어오는 sql문을 작성하고있는데요. 오류코드가 발생하지 않는 문제가 발생해서 질문올립니다 ㅠㅠㅠ
[ 제가 친 코드]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<style>
table{border:1px solid gray; border-collapse:collapse;}
td{border:1px solid gray;padding:5px;}
</style>
</head>
<body>
<?php
$conn = mysqli_connect("localhost", "----", "------");
mysqli_query($conn,'SET NAMES utf8');
if (!$conn) {
echo "Unable to connect to DB: " . mysqli_error();
exit;
}
if (!mysqli_select_db($conn,"sj_test")) {
echo "Unable to select mydbname: " . mysqli_error();
exit;
}
$sql = "SELECT *
FROM test1 as a, test2 as b
WHERE a.id=b.id
LIMIT 10";
$result = mysqli_query($conn,$sql);
if (!$result) {
echo "could not successfully run query ($sql) from DB: " . mysqli_error($conn);
exit;
}
if (mysqli_num_rows($result) == 0) {
echo "No rows found, nothing to print so am exiting";
exit;
}
echo "<table>";
while ($row = mysqli_fetch_assoc($result)) {
echo "<tr>
<td>{$row['a.id']}</td>
<td>{$row['a.c_name']}</td>
<td>{$row['a.b_name']}</td>
<td>{$row['a.f_safe']}</td>
<td>{$row['a.s_type']}</td>
<td>{$row['a.p_number']}</td>
<td>{$row['b.s_name']}</td>
<td>{$row['b.t_service']}</td>
<td>{$row['b.s_price']}</td>
</tr>";
}
echo "</table>";
mysqli_free_result($result);
?>
</body>
</html>
[결과값]
오류코드도 안보이고.... 원인이 무엇일까요?