PHP

PHP : mysqli_num_rows — 결과 집합의 행 수를 가져오기

제주도 조랑말 2023. 5. 3. 10:30
728x90

<?php

mysqli_report
(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");

$result = $mysqli->query("SELECT Code, Name FROM Country ORDER BY Name");

/* Get the number of rows in the result set */
$row_cnt = $result->num_rows;

printf("Result set has %d rows.\n", $row_cnt);

 

 

728x90

'PHP' 카테고리의 다른 글

PHP : php다운로드, Apache 다운로드  (0) 2023.07.05
PHP : 게시판 페이징 구현하기  (0) 2023.05.03
PHP : $_SESSION, session 종료  (0) 2023.04.20
PHP : isset() 과 empty() 차이  (0) 2023.04.11
PHP : OOP(class) 폼으로 전송받기  (0) 2023.04.11