Membuat Page Dynamic Dengan PHP MySQL

Jika anda memiliki "Dinamic Website" yang besar dan memiliki ribuan item/product anda pasti kesulitan untuk menampilkan item tersebut satu persatu secara beraturan, otomatis dan terkendali. Solusinya adalah anda bisa memakai halaman seperti Google.

<-1 2 3->

Halaman tersebut contentnya di ambil dari database MySql, selain itu kita juga bisa
menentukan berapa item yang akan kita tampilkan per-halaman. Menarik bukan?

Pertama buat database :
CREATE DATABASE isi;
kemudian Aktifkan Database
USE isi;

Buat Tabel database (ini hanya contoh):
CREATE TABLE `content` (
`id` int(225) NOT NULL auto_increment,
`judul` varchar(50) NOT NULL default '',
`isi` longtext NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM ;

lalu buat file PHP (ketikkan pada Notepad) dengan nama Koneksidb.php :
<?php
$dbhost = 'localhost';
$dbusername = 'root';
$dbpasswd = ' ';
$database_name = 'isi';

$connection = mysql_connect("$dbhost","$dbusername","$dbpasswd") or die
("MySql Putus tidak bisa connect ke server");
$db = mysql_select_db("$database_name", $connection) or die("Database tidak ditemukan");
?>

Lalu buat file untuk menampilkan page tersebut. Buat File dengan nama Tampil.php :
include "Koneksidb.php";
<?php
if($hal == 0){
$hal=1;
}
else{
$hal = $_GET[hal];
}
query = mysql_query("Select * from content where id='$hal'");
while($hasil = mysql_fetch_array($query)){
echo "$hasil[judul]";
echo "$hasil[isi]";

for($i=1; $i<=6; $i++)
{
echo "<a href="Tampil.php?hal="$i">$i</a>";
}
?>

Ok Sob.. Bisa ngerti khan. Kalo kurang mengerti silahkan kasih komen. Terima kasih

Aplikasi Penjualan Sederhana berbasis PHP dan MySQL

Aplikasi sederhana ini saya buat ketika melakukan Ujian Program semester 5 di kuliah. Aplikasi ini terdiri dari pencatatan barang masuk, penjualan (perhari, bulan, tahun, dan per faktur). Semoga bermanfaat dan dapat dijadikan sebagai referensi pembelajaran. Silahkan klik Disini untuk mendowload Aplikasi ini. Silahkan komen dan request apa saja. Semoga saya dapat membantu. Terima kasih

Download

Menghitung Nilai Mahasiswa : MySQL Query

Dalam menjalankan Query MySQL diperlukan 2 buah tabel master yang akan digabungkan. Dalam artikel ini kita misalkan untuk menghitung Nilai Mahasiswa. Tabel pertama: tabel mahasiswa, tabel kedua: Tabel matakuliah.

1. Buatlah database menggunakan MySQL (nama database terserah).
create database nilai_mahasiswa;
use nilai_mahasiswa;
perintah use digunakan untuk mengaktifkan database.

2. Buatlah tabel mahasiswa
create table mahasiswa ( id_mhs int(4) primary key, nama varchar(50));
hanya untuk contoh maka saya hanya menggunakan 2 field saja.
kemudian isikan data pada tabel mahasiswa tersebut.
INSERT INTO mahasiswa VALUES (1, "Muhammad Amin");
INSERT INTO mahasiswa VALUES (2, "Muhammad Ikhlas");
INSERT INTO mahasiswa VALUES (3, "Muhammad Syarief");

kemudian lihat apakah data telah berhasil diisi.
SELECT * FROM mahasiswa;

2. Buatlah table mata kuliah
create table matakuliah(id_mk int(4) primary key, matakuliah varchar(50), sks int(4));
kemudian isikan data :
INSERT INTO matakuliah VALUES (1, "Pemrograman Web",3);
INSERT INTO matakuliah VALUES (2, "Riset operasi",2);
INSERT INTO matakuliah VALUES (3, "Pemrograman java",2);

3. Buatlah table nilai
create table nilai(id_mk int(4) primary key, id_mhs int(4), nilai float(10));
kemudian isikan data :
INSERT INTO nilai VALUES (1, 1,60);
INSERT INTO nilai VALUES (2, 1,70);
INSERT INTO nilai VALUES (3, 1,80);

INSERT INTO nilai VALUES (1, 2,70);
INSERT INTO nilai VALUES (2, 2,80);
INSERT INTO nilai VALUES (3, 2,70);

INSERT INTO nilai VALUES (1, 3,80);
INSERT INTO nilai VALUES (2, 3,90);
INSERT INTO nilai VALUES (3, 3,80);

4. Untuk melihat nilai, ketikkan perintah berikut ini:
SELECT * from mahasiswa, nilai, matakuliah where nilai.id_mk=matakuliah.id_mk and nilai.id_mhs=mahasiswa.id_mhs;
maka nilai setiap mahasiswa akan muncul sesuai dengan ID nya.

Terima Kasih semoga bermanfaat. Silahkan komen dan request.

Apache Server

The Apache HTTP Server, commonly referred to as Apache is a web server notable for playing a key role in the initial growth of the World Wide Web and in 2009 became the first web server to surpass the 100 million web site milestone. Apache was the first viable alternative to the Netscape Communications Corporation web server (currently known as Sun Java System Web Server), and has since evolved to rival other Unix-based web servers in terms of functionality and performance. The majority of all web servers using Apache are Linux web servers.

Apache is developed and maintained by an open community of developers under the auspices of the Apache Software Foundation. The application is available for a wide variety of operating systems, including Unix, GNU, FreeBSD, Linux, Solaris, Novell NetWare, Mac OS X, Microsoft Windows, OS/2, TPF, and eComStation. Released under the Apache License, Apache is characterized as free software and open source software. 

Since April 1996 Apache has been the most popular HTTP server on the World Wide Web. As of March 2009 Apache served over 46% of all websites and over 66% of the million busiest.

MySQL

MySQL is a relational database management system (RDBMS) which has more than 6 million installations. The program runs as a server providing multi-user access to a number of databases.

The project's source code is available under terms of the GNU General Public License, as well as under a variety of proprietary agreements. MySQL is owned and sponsored by a single for-profit firm, the Swedish company MySQL AB, now a subsidiary of Sun Microsystems, which holds the copyright to most of the codebase. On April 20th, 2009 Oracle Corp., which develops and sells the proprietary Oracle database, announced a deal to acquire Sun Microsystems.

PHP (Hypertext Preprocessor)

While PHP was originally created by Rasmus Lerdorf in 1995, the main implementation of PHP is now produced by The PHP Group and serves as the de facto standard for PHP as there is noformal specification. PHP is free software released under the PHP License, however it is incompatible with the GNU General Public License (GPL), due to restrictions on the usage of the term PHP. 

PHP is a widely-used general-purpose scripting language that is especially suited for web development and can be embedded into HTML. It generally runs on a web server, taking PHP code as its input and creating web pages as output. It can be deployed on most web servers and on almost every operating system and platform free of charge. PHP is installed on more than 20 million websites and 1 million web servers.