<?php

include ('./db_info.php');


$connect = mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD);


$connect = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);


if(!$connect){

echo "Error: Unable to connect to MySQL." . PHP_EOL;

echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL;

echo "Debugging error: " . mysqli_connect_error() . PHP_EOL;

exit();

}


if ($result = mysqli_query($connect,"SELECT * FROM TEST")){


$total_record = mysqli_num_rows($result); //레코드 개수

$total_fields = mysqli_num_fields($result); //필드 개수

}

?>



'공부 > php' 카테고리의 다른 글

(json) jsonobject 안에 jsonarray  (0) 2016.04.28
(php) json 한글 유니코드  (2) 2016.04.23
(php db연결) select 후 json 만들기  (1) 2016.04.23
(db연결) mysql_connect 연결 실패  (0) 2016.04.23

+ Recent posts