Nama Database: Babook Nama File: Komen - Simpan - PHP
The document describes the database and files for a social media website called babook. It includes the tables status and comments in the Nama Database babook. It then lists the PHP files and their purposes, including status_form.php for creating a status, status.php for viewing statuses, status_kirim.php for posting a status, suka.php for liking a status, komen_simpan.php for posting a comment, and style.css for styling. The files work together to allow users to post statuses and comments, and like other users' statuses.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
28 views1 page
Nama Database: Babook Nama File: Komen - Simpan - PHP
The document describes the database and files for a social media website called babook. It includes the tables status and comments in the Nama Database babook. It then lists the PHP files and their purposes, including status_form.php for creating a status, status.php for viewing statuses, status_kirim.php for posting a status, suka.php for liking a status, komen_simpan.php for posting a comment, and style.css for styling. The files work together to allow users to post statuses and comments, and like other users' statuses.
Nama File : status_kirim.php <?php $koneksi=mysql_connect("localhost","root","yawina"); $db=mysql_select_db("babook"); $nama=$_POST['nama']; $isi_status=$_POST['isi_status']; $tanggal=date("Y-m-d h:i:s"); $sqlx="insert into status (nama,isi_status,tanggal) values ('$nama','$isi_status','$tanggal')"; $kirim=mysql_query($sqlx); ?> <meta http-equiv="refresh" content="1;url=status.php">
Nama File : suka.php <?php $koneksi=mysql_connect("localhost","root","yawina"); $db=mysql_select_db("babook"); $id=$_GET['id']; $sql="select * from status where id_status='$id'"; $result=mysql_query($sql); $data=mysql_fetch_array($result); $suka=$data['suka']; $suka1=$suka+1; $sqlx="update status set suka='$suka1' where id_status='$id'"; $rubah=mysql_query($sqlx); ?> <meta http-equiv="refresh" content="1;url=status.php">
Nama File : komen_simpan.php <?php $koneksi=mysql_connect("localhost","root","yawina"); $db=mysql_select_db("babook"); $id_status=$_POST['id_status']; $nama=$_POST['nama']; $isi_komen=$_POST['isi_komen']; $tanggal=date("Y-m-d h:i:s"); $sqlx="insert into komen (nama,isi_komen,tgl,id_status) values ('$nama','$isi_komen','$tanggal','$id_status')"; $kirim=mysql_query($sqlx); $sql="select * from status where id_status='$id_status'"; $result=mysql_query($sql); $data=mysql_fetch_array($result); $komen=$data['komen']; $komen1=$komen+1; $sqlx="update status set komen='$komen1' where id_status='$id_status'"; $rubah=mysql_query($sqlx); ?> <meta http-equiv="refresh" content="1;url=status.php">