반응형
이유를 잘 모르겠습니다. 그러나 아래에서 만든 코드가 작동하지 않습니다. "$ num_rows"변수가 설정되지 않았으며 값도 없습니다 (0도 아님). 이 문제가 발생하는 이유를 아는 사람이 있습니까?
$result2 = mysql_query("SELECT * FROM `mycity_vehicles` WHERE `id` = '$vehID'");
while($row2 = mysql_fetch_array($result2))
$num_rows = mysql_num_rows($result2);
{
if(empty($num_rows)) {
echo "empty";
}
else {
echo $num_rows;
}
해결 방법
구문이 꺼져 있습니다.
while($row2 = mysql_fetch_array($result2))
$num_rows = mysql_num_rows($result2);
{
아마도
$num_rows = mysql_num_rows($result2);
while($row2 = mysql_fetch_array($result2))
{
참조 페이지 https://stackoverflow.com/questions/20689246
반응형
'MySql' 카테고리의 다른 글
MySQL 전체 응용 프로그램에서 하나의 데이터베이스 연결 개체를 어떻게 사용할 수 있습니까? (0) | 2020.12.15 |
---|---|
MySQL 열 수가 행 1의 값 수와 일치하지 않습니다. (0) | 2020.12.15 |
MySQL PDOException SQLSTATE [HY000] [2002] 해당 파일 또는 디렉토리가 없습니다. (0) | 2020.12.15 |
MySQL 로그인 비밀번호 용 PHP 솔트 및 해시 SHA256 (0) | 2020.12.15 |
MySQL PHP and MySQL Select a Single Value (0) | 2020.12.15 |
댓글