나는 내가 특정 ID의 기록을 보여주기 위해이 페이지를 만들려하지만 나에게이 프로그램의 PHP 코드이 오류
여러 행을 가져 오려고하는데 행을 가져 오는 중에 오류가 있습니까?
Notice: Undefined variable: mysqli in line 82.
Fatal error: Call to a member function query() on a non-object in line 82.
을 보이고있다. = mysqli_connect
$con=mysqli_connect("XXXX","XXXX","XXXX","XXXX");
if (mysqli_connect_errno())
echo "Failed to connect to MySQL: " . mysqli_connect_error();
$id = $_GET['id'];
$sql = "SELECT * FROM details WHERE cat_id = $id";
$result = mysqli_query($con,$sql); //line #82
$row = mysqli_fetch_array($result);
while($row = mysqli_fetch_array($result)){
$id = $row['cat_id'];
echo "<tr>";
echo "<td><a href='detail.php?id=$id' >" . $row['cat_name'] . "</a></td>";
echo "</tr>";
}
echo "<table>";
echo "<tr>";
echo "<th>name</th>";
echo "<th>address</th>";
echo "<th>phone</th>";
echo "<th>uan</th>";
echo "<th>location</th>";
echo "</tr>";
mysqli_close($con);
당신은 라인 (82)을 표시 할 수 있습니다? –
";}"이라고 가정합니다. ... – user1844933
코드에서 멤버 함수'query'에 대한 호출이 없습니다. – Barmar