습관제작소
23-01-25 AWS(PHP 실습) #7-2 본문
- DB 설정 및 연결
- 리눅스에서 DB생성
create database exam;
use exam;
create table sungjuk
(
hakbun varchar(20) not null primary key,
name varchar(20),
kor int,
eng int,
mat int,
tot int,
avg int
);
- PHP에서 DB연결 확인
<?php
header("Content-Type:text/html;charest=utf-8");
$con = mysqli_connect("localhost","root","1234","exam") or die("db 연결 실패");
echo "DB연결 성공";
/*
if($con){
echo "DB연결 성공";
}else{
echo "DB연결 실패";
}
*/
?>
- index.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <h1> 사이트에 오신걸 환영합니다.</h1> <a href="sform.html">(1) 성적 등록 </a> <p> <a href="slist.php"> (2) 성적 리스트 </a> <p> <form method=get action=sslist.php> (3) 상위 원하는 순위 입력 : <input type=text name=rank> <input type=submit value="등수"> </form> <form method=get action=glist.php> (4) 합격 여부(pass/fail입력) : <input type=text name=grade> <input type=submit value="합격여부"> </form> </body> </html>
----
'SMHRD or ITSchool > IoT. AWS' 카테고리의 다른 글
23-01-30 AWS(Lightsail) #9 (0) | 2023.01.30 |
---|---|
23-01-26 AWS(ELB, DNS 라운드로빈방식) #8 (0) | 2023.01.26 |
23-01-25 AWS(PHP 실습) #7-1 (0) | 2023.01.25 |
23-01-19 AWS(DBserver 만들기) #6 (0) | 2023.01.25 |
23-01-18 AWS(S3 활용, Cloud Front) #5 (0) | 2023.01.19 |
Comments