HTML FORM CODE 관리 : article
수정 입력
<div class='basic_form_div'>
<form name='basic_form' method='post' action='' target='data_exec_frame'>
<input type='text' class='basic_input_class' name='no' value='$no'>
<input type='text' class='basic_input_class' name='article_id' value='$article_id'>
<input type='text' class='basic_input_class' name='member_no' value='$member_no'>
<input type='text' class='basic_input_class' name='subject' value='$subject'>
<input type='text' class='basic_input_class' name='title' value='$title'>
<input type='text' class='basic_input_class' name='body' value='$body'>
<input type='text' class='basic_input_class' name='tags' value='$tags'>
<input type='text' class='basic_input_class' name='saved' value='$saved'>
<input type='text' class='basic_input_class' name='hits' value='$hits'>
<input type='text' class='basic_input_class' name='likes' value='$likes'>
</form>
</div>
생성된 테이블 목록 :
BLANK$no=$_POST['no'];
$article_id=$_POST['article_id'];
$member_no=$_POST['member_no'];
$subject=$_POST['subject'];
$title=$_POST['title'];
$body=$_POST['body'];
$tags=$_POST['tags'];
$saved=$_POST['saved'];
$hits=$_POST['hits'];
$likes=$_POST['likes'];
인서트문(INSERT/CREATE)
$insert_query="insert into `article`( `no`, `article_id`, `member_no`, `subject`, `title`, `body`, `tags`, `saved`, `hits`, `likes`) values( '$no', '$article_id', '$member_no', '$subject', '$title', '$body', '$tags', '$saved', '$hits', '$likes')";
mysqli_query($connect,$insert_query);
업데이트문(UPDATE/MODIFY)
$update_query="update `article` set `article_id`='$article_id', `member_no`='$member_no', `subject`='$subject', `title`='$title', `body`='$body', `tags`='$tags', `saved`=now(), `hits`='$hits', `likes`='$likes' where `no` like '$no'";
mysqli_query($connect,$update_query);
셀렉트문(READ/VIEW) : Multi-values
$records_query="select * from `article` where `NO` like '$no'";
$records_result=mysqli_query($connect,$records_query);
$records_num=mysqli_affected_rows($connect);
for($i=0;$i<$records_num;$i++) {
$record_row=mysqli_fetch_array($records_result);
//your code for table record value
}
셀렉트문(READ/VIEW) : Specific-value
$record_query="select * from `article` where `NO` like '$no'";
$record_result=mysqli_query($connect,$record_query);
$record_row=mysqli_fetch_array($record_result);
//your code for table record value
델리트문(DELETE/ERASE)
$delete_query="delete from `article` where `NO` like '$no'";
mysqli_query($connect,$delete_query);