<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>mysql &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://wordpress.com/tag/mysql/</link>
	<description>Feed of posts on WordPress.com tagged "mysql"</description>
	<pubDate>Sat, 30 Aug 2008 17:00:47 +0000</pubDate>

	<generator>http://wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[MYSQL dan PHP]]></title>
<link>http://mnrizal.wordpress.com/2008/08/30/mysql/</link>
<pubDate>Sat, 30 Aug 2008 12:35:30 +0000</pubDate>
<dc:creator>Mohamad Noor Rizal</dc:creator>
<guid>http://mnrizal.wordpress.com/2008/08/30/mysql/</guid>
<description><![CDATA[TUJUAN UMUM
Dapat membuat aplikasi web database dengan menggunakan database MYSQL

TUJUAN KHUSUS
Mam]]></description>
<content:encoded><![CDATA[<p><strong>TUJUAN UMUM</strong></p>
<p class="western" style="margin-left:0.25in;margin-bottom:0;" align="justify">Dapat membuat aplikasi web database dengan menggunakan database MYSQL</p>
<p class="western" style="margin-left:0.25in;margin-bottom:0;" align="justify">
<p style="margin-bottom:0;page-break-after:avoid;" align="justify"><strong>TUJUAN KHUSUS</strong></p>
<p class="western" style="margin-bottom:0;" align="justify">Mampu menerapkan fungsi – fungsi php untuk koneksi ke database mysql</p>
<p class="western" style="margin-bottom:0;" align="justify">
<p style="margin-bottom:0;page-break-after:avoid;" align="justify"><strong>MATERI KULIAH</strong></p>
<p class="western" style="margin-bottom:0;" align="justify"><strong>MySQL</strong> adalah salah satu database yang yang <em>free</em> (gratis) yang biasa digunakan untuk menyimpan data – data dari suatu program aplikasi web dan <strong>MySQL</strong> ini biasanya selalu dikompbinasikan dengan <strong>PHP</strong>. Dalam php terdapat banyak fungsi untuk mengakses dan mengelola database <strong>MySQL</strong>, berikut fungsi – fungsi tersebut :</p>
<p class="western" style="margin-bottom:0;" align="justify">
<ol>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><strong>Fungsi 	mysql_connect</strong></p>
</li>
</ol>
<p style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini digunakan untuk membuat hubungan ke database <strong>MySQL</strong> yang terdapat pada suatu host, bentuk pemanggilannya :</p>
<p style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>mysql_connect</strong>(<em>host,nama_pemakai, password</em>)</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify"><strong>Argumen</strong></p>
<ul>
<li>
<p class="western" style="margin-bottom:0;" align="justify">host 	menyatakan nama host tempat <strong>MySQL</strong> berada</p>
</li>
<li>
<p class="western" style="margin-bottom:0;" align="justify">pemakai 	adalah nama pemakai yang mempunyai akses ke database <strong>MySQL</strong> tersebut</p>
</li>
<li>
<p class="western" style="margin-bottom:0;" align="justify">Password 	adalah kata kunci untuk membuka hubungan tersebut.</p>
</li>
</ul>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini mengembalikan nilai TRUE jika hubungan berhasil dibuka dan FALSE jika sebaliknya.</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify"><strong>Contoh</strong></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>$id_mysql = mysql_connect</strong>(<em>“localhost”, “php”,”pinguin”</em>)</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<ol>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><strong>Fungsi 	mysql_close</strong></p>
</li>
</ol>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini digunakan untuk menutup hubungan dengan database <strong>MySQL</strong>, bentuk pemanggilannya:</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>mysql_close(</strong><em>id_mysql</em><strong>)</strong></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>Argumen </strong></p>
<p style="margin-left:0.5in;margin-bottom:0;" align="justify"><em>id_mysql</em> adalah pengenal yang didapatkan dari variable pemaggilan fungsi <em>mysql_connect.</em></p>
<p style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><strong>Contoh :</strong></p>
<dl>
<dd>
<table id="tias85" border="1" cellspacing="0" cellpadding="8" width="534"><col width="516"></col></p>
<tbody>
<tr>
<td width="516" valign="top">
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">Tes 				MySQL</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">&#60;?php</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$pemakai  = 				"php";</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$password = 				"pinguin";</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$id_mysql = 				mysql_connect("localhost",</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$pemakai,</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$password);</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if 				(! $id_mysql)</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">die("Database 				MySQL tak dapat dibuka");</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">mysql_close($id_mysql);</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">print("Sukses");</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">?&#62;</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" align="justify">
</td>
</tr>
</tbody>
</table>
</dd>
</dl>
<p class="western" style="margin-left:0.25in;margin-bottom:0;" align="justify">
<ol>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><strong>Fungsi 	mysql_select_db</strong></p>
</li>
</ol>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini berguna untuk memilih database, cara pemenggilannya :</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>mysql_select_db</strong>(<em>database, pengenal_hubungan</em>)</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>Argumen</strong></p>
<ul>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><em>pengenal_hubungan</em> adalah pengenal/variable yang diperoleh pada fungsi <strong>mysql_connect</strong></p>
</li>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><em>database</em> adalah nama database yang dipilih</p>
</li>
</ul>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>contoh :</strong></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>mysql_select_db</strong>(<em>“mhs”,$id_mysql</em>);</p>
<p class="western" style="margin-bottom:0;" align="justify">
<ol>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><strong>Fungsi 	mysql_query</strong></p>
</li>
</ol>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini digunakan untuk mengakses statemen sql terhadap suatu tabel, cara pemenggilannya adalah :</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>mysql_query</strong>(<em>permintaan , pengenal_hubungan</em>)</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify"><strong>Argumen</strong></p>
<ul>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><em>pengenal_hubungan</em> adalah pengenal/variable yang diperoleh pada fungsi <strong>mysql_connect</strong></p>
</li>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><em>permintaan</em> merupakan statement sql.</p>
</li>
</ul>
<p class="western" style="margin-bottom:0;" align="justify">
<ol>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><strong>Fungsi 	mysql_db_query</strong></p>
</li>
</ol>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini digunakan untuk menjalankan suatu permintaan terhadap suatu database. Bentuk pemanggilan :</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>mysql_db_query</strong>(<em>database, permintaan,pengenal_hubungan</em>)</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>Argumen :</strong></p>
<ul>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><em>pengenal_hubungan</em> adalah pengenal/variable yang diperoleh pada fungsi <strong>mysql_connect.</strong></p>
</li>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><em>database</em> adalah database yang dipilih.</p>
</li>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><em>permintaan</em> berupa peryataan/statement sql</p>
</li>
</ul>
<p class="western" style="margin-bottom:0;" align="justify">
<ol>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><strong>Fungsi 	mysql_num_rows</strong></p>
</li>
</ol>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini berguna untuk memperoleh sejumlah baris dari suatu hasil permintaan query. Bentuk pemanggilannya adalah :</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>mysql_num_rows</strong>(<em>pengenal_hasil</em>)</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify"><strong>Argumen</strong></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><em>pengenal_hasil</em> menyatakan nilai yang diperoleh dari pemanggilan fungsi seperti <strong>mysql_db_query</strong> atau <strong>mysql_query</strong>.</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<ol>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><strong>Fungsi 	mysql_affected_row</strong></p>
</li>
</ol>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini digunakan untuk memperolah jumlah baris yang dikenai seperti operasi INSERT, DELETE dan UPDATE, bentuk pemanggilannya:</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>mysql_affected_rows</strong>(<em>[pengenal_hubungan]</em>)</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>Argumen :</strong></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><em>pengenal_hubungan</em> adalah pengenal/variable yang diperoleh pada fungsi <strong>mysql_connect.</strong></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<ol>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><strong>Fungsi 	mysql_num_fields</strong></p>
</li>
</ol>
<p style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini berguna untuk memperoleh jumlah kolom pada suatu hasil permintaan, bentuk pemanggilannya :</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>mysql_num_field</strong>(<em>pengenal_hasil</em>)</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify"><strong>Argumen</strong></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><em>Pengenal_hasil</em> menyatakan nilai yang diperoleh dari pemanggilan fungsi seperti <strong>mysql_db_query</strong> atau <strong>mysql_query.</strong></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>Contoh :</strong></p>
<dl>
<dd>
<table id="tias289" border="1" cellspacing="0" cellpadding="8" width="534"><col width="516"></col></p>
<tbody>
<tr>
<td width="516" valign="top">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">Mengetahui 				Jumlah Hasil Permintaan</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">&#60;?php</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$pemakai  = 				"php";</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$password = 				"pinguin";</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$id_mysql = 				mysql_connect("localhost",</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$pemakai,</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$password);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if 				(! $id_mysql)</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">die("Database 				MySQL tak dapat dibuka");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if 				(! mysql_select_db("bukualmt", $id_mysql))</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">die("Database 				tidak bisa dipilih");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$hasil = 				mysql_query("SELECT * FROM kota",</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$id_mysql);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if 				(! $hasil)</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">die("Permintaan 				gagal dilaksanakan");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$jum_kolom = 				mysql_num_rows($hasil);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">print("Jumlah 				kolom : $jum_kolom<br />
n");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$jum_baris = 				mysql_num_rows($hasil);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">print("Jumlah 				baris : $jum_baris<br />
n");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">mysql_close($id_mysql);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">?&#62;</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western"><span style="font-family:Courier New,monospace;"></span></p>
</td>
</tr>
</tbody>
</table>
</dd>
</dl>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<ol>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><strong>Fungsi 	mysql_fetch_row</strong></p>
</li>
</ol>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini menghasilkan suatu array yang berisi seluruh kolom dari sebuah baris pada suatu himpunan hasil. Bentuk pemanggilannya :</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>mysql_fetch_row</strong>(<em>pengenal hasil</em>)</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify"><strong>Argumen</strong></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><em>Pengenal_hasil</em> menyatakan nilai yang diperoleh dari pemanggilan fungsi seperti <strong>mysql_db_query</strong> atau <strong>mysql_query.</strong></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<dl>
<dd>
<table id="tias408" border="1" cellspacing="0" cellpadding="8" width="534"><col width="516"></col></p>
<tbody>
<tr>
<td width="516" valign="top">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">Menampilkan 				Daftar Kota</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">&#60;?php</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$pemakai  = 				"php";</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$password = 				"pinguin";</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$id_mysql = 				mysql_connect("localhost",</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$pemakai,</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$password);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if 				(! $id_mysql)</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">die("Database 				MySQL tak dapat dibuka");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if 				(! mysql_select_db("bukualmt", $id_mysql))</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">die("Database 				tidak bisa dipilih");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$hasil = 				mysql_query("SELECT * FROM kota",</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$id_mysql);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if 				(! $hasil)</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">die("Permintaan 				gagal dilaksanakan");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">while ( $baris = 				mysql_fetch_row($hasil) )</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">{</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">print("$baris[0] 				- $baris[1]<br />
n");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">}</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">mysql_close($id_mysql);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">?&#62;</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
</td>
</tr>
</tbody>
</table>
</dd>
</dl>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify">
<ol>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><strong>Fungsi 	mysql_fetch_array</strong></p>
</li>
</ol>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini mempunyai kegunaan serupa dengan <strong>mysql_fetch_row</strong>, hanya saja kolom akan disimpan dua kali pada array hasil, yang pertama memiliki indexs angka dimulai dengan 0 dan yeng kedua berindekan nama kolom bentuk pemanggilannya :</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>mysql_fetch_array</strong>(<em>pengenal_hasil</em>);</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify"><strong>Argumen</strong></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><em>Pengenal_hasil</em> menyatakan nilai yang diperoleh dari pemanggilan fungsi seperti <em>mysql_db_query</em> atau <em>mysql_query</em>.</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<ol>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><strong>Fungsi 	mysql_fetch_field</strong></p>
</li>
</ol>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini berguna untuk memperolh informasi suatu kolom, format pemanggilannya :</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>mysql_fetch_field</strong>(<em>pengenal_hasil,nomor_kolom</em>)</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify"><strong>Argumen</strong></p>
<ul>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><em>Pengenal_hasil</em> menyatakan nilai yang diperoleh dari pemanggilan fungsi seperti 	<strong>mysql_db_query</strong> atau <strong>mysql_query.</strong></p>
</li>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><em>nomor_kolom</em> menyatakan nomor kolom yang informasinya ingin didapat</p>
</li>
</ul>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">fungsi ini memberikan hasil berupa suatu object, berikut daftar object yang dikembalikan oleh fungsi mysql</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<dl>
<dd>
<table id="tias563" border="1" cellspacing="0" cellpadding="8" width="534"><col width="108"></col> <col width="392"></col></p>
<tbody>
<tr valign="top">
<td width="108">
<p class="western" align="justify">Properti</p>
</td>
<td width="392">
<p class="western" align="justify">Keterangan</p>
</td>
</tr>
<tr valign="top">
<td width="108">
<p class="western" align="justify">Blob</p>
</td>
<td width="392">
<p class="western">Properti bernilai 1 jika kolom berupa BLOB</p>
</td>
</tr>
<tr valign="top">
<td width="108">
<p class="western" align="justify">Max_length</p>
</td>
<td width="392">
<p class="western" align="justify">Panjang maksimum kolom</p>
</td>
</tr>
<tr valign="top">
<td width="108">
<p class="western" align="justify">Multiple_key</p>
</td>
<td width="392">
<p class="western" align="justify">Bernilai 1 jika kolom adalah 				kunci yang tidak unik</p>
</td>
</tr>
<tr valign="top">
<td width="108">
<p class="western" align="justify">Name</p>
</td>
<td width="392">
<p class="western" align="justify">Menyatakan nama kolom</p>
</td>
</tr>
<tr valign="top">
<td width="108">
<p class="western" align="justify">Not_null</p>
</td>
<td width="392">
<p class="western" align="justify">Bernilai 1 jika kolom tak dapat 				kosong</p>
</td>
</tr>
<tr valign="top">
<td width="108">
<p class="western" align="justify">Numeric</p>
</td>
<td width="392">
<p class="western" align="justify">Bernilai 1 jika kolom bertype 				numeric</p>
</td>
</tr>
<tr valign="top">
<td width="108">
<p class="western" align="justify">Primary_key</p>
</td>
<td width="392">
<p class="western" align="justify">Bernilai 1 jika kolom adalah 				kunci primer</p>
</td>
</tr>
<tr valign="top">
<td width="108">
<p class="western" align="justify">Table</p>
</td>
<td width="392">
<p class="western" align="justify">Nama tabel milik kolom</p>
</td>
</tr>
<tr valign="top">
<td width="108">
<p class="western" align="justify">Unique_key</p>
</td>
<td width="392">
<p class="western" align="justify">Bernilai 1 jika kolom adalah 				kunci unik</p>
</td>
</tr>
<tr valign="top">
<td width="108">
<p class="western" align="justify">Unsigned</p>
</td>
<td width="392">
<p class="western" align="justify">Bernilai 1 jika kolom berisi 				bilangan bertanda</p>
</td>
</tr>
<tr valign="top">
<td width="108">
<p class="western" align="justify">Zerofill</p>
</td>
<td width="392">
<p class="western" align="justify">Bernilai 1 jika kolom dipenuhi 				nol</p>
</td>
</tr>
</tbody>
</table>
</dd>
</dl>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify"><strong>Contoh</strong></p>
<dl>
<dd>
<table id="tias633" border="1" cellspacing="0" cellpadding="8" width="534"><col width="516"></col></p>
<tbody>
<tr>
<td width="516" valign="top">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">Menampilkan 				Info Kolom Tabel daftar</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">&#60;?php</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$pemakai  = 				"php";</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$password = 				"pinguin";</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$id_mysql = 				mysql_connect("localhost",</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$pemakai,</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$password);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if 				(! $id_mysql)</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">die("Database 				MySQL tak dapat dibuka");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if 				(! mysql_select_db("bukualmt", $id_mysql))</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">die("Database 				tidak bisa dipilih");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$hasil = 				mysql_query("SELECT * FROM daftar",</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$id_mysql);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if 				(! $hasil)</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">die("Permintaan 				gagal dilaksanakan");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">while ( $objek = 				mysql_fetch_field($hasil) )</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">{</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$ket_kunci = 				$objek-&#62;primary_key ? "Ya": "Tidak";</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">print("Nama 				kolom : $objek-&#62;name<br />
n");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">print("Panjang 				kolom : $objek-&#62;max_length<br />
n");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">print("Sebagai 				kunci primer: $ket_kunci<br />
n");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">print("<br />
n");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">}</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">mysql_close($id_mysql);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">?&#62;</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
</td>
</tr>
</tbody>
</table>
</dd>
</dl>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<ol>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><strong>Fungsi 	mysql_data_seek</strong></p>
</li>
</ol>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini berguna untuk memindahkan pointer ke lokasi tertentu, bentuk pemanggilan :</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>mysql_data_seek</strong>(<em>pengenal_hasil, nomor_baris</em>)</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify"><strong>Argumen</strong></p>
<ul>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><em>Pengenal_hasil</em> menyatakan nilai yang diperoleh dari pemanggilan fungsi seperti 	<strong>mysql_db_query</strong> atau <strong>mysql_query.</strong></p>
</li>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><em>Nomor_baris</em> menyatakan nomor baris yang dituju.</p>
</li>
</ul>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini mengembalikan nilai true jika berhasil dan false jika gagal</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify"><strong>Contoh</strong></p>
<dl>
<dd>
<table id="tias775" border="1" cellspacing="0" cellpadding="8" width="534"><col width="516"></col></p>
<tbody>
<tr>
<td width="516" valign="top">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">Contoh 				mysql_data_seek</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">&#60;?php</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$pemakai  = 				"php";</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$password = 				"pinguin";</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$id_mysql = 				mysql_connect("localhost",</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$pemakai,</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$password);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if 				(! $id_mysql)</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">die("Database 				MySQL tak dapat dibuka");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if 				(! mysql_select_db("bukualmt", $id_mysql))</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">die("Database 				tidak bisa dipilih");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$hasil = 				mysql_query("SELECT * FROM kota",</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$id_mysql);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if 				(! $hasil)</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">die("Permintaan 				gagal dilaksanakan");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">mysql_data_seek($hasil, 				3);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">while ( $baris = 				mysql_fetch_row($hasil) )</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">{</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">print("$baris[0] 				- $baris[1]<br />
n");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">}</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">mysql_close($id_mysql);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">?&#62;</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western"><span style="font-family:Courier New,monospace;"></span></p>
</td>
</tr>
</tbody>
</table>
</dd>
</dl>
<p class="western" style="margin-bottom:0;" align="justify">
<ol>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><strong>Fungsi 	mysql_field_seek</strong></p>
</li>
</ol>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini berguna untuk memindah pointer pada suatu himpunan hasil supaya menuju kolom tertentu. Format pemanggilannya adalah :</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>mysql_field_seek</strong>(<em>pengenal_hasil, nomor_kolom</em>)</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify"><strong>Argumen</strong></p>
<ul>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><em>Pengenal_hasil</em> menyatakan nilai yang diperoleh dari pemanggilan fungsi seperti 	<strong>mysql_db_query</strong> atau <strong>mysql_query</strong>.</p>
</li>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><em>Nomor_kolom</em> adalah nomor kolom yang akan dituju</p>
</li>
</ul>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini mengembalikan nilai true jika berhasil dan false jika gagal</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<ol>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><strong>Fungsi 	mysql_create_db</strong></p>
</li>
</ol>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini digunakan untuk menciptakan database <strong>MySQL</strong>. Format pemanggilannya :</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>mysql_create_db</strong>(<em>database, pengenal_hubungan</em>)</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify"><strong>Argumen</strong></p>
<ul>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><em>database</em> adalah database yang ingin dibuat</p>
</li>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><em>pengenal_hubungan</em> adalah pengenal/variable yang diperoleh pada fungsi <strong>mysql_connect</strong></p>
</li>
</ul>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini mengembalikan nilai TRUE jika berhasil dan FALSE jika gagal</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<ol>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><strong>Fungsi 	mysql_drop_db</strong></p>
</li>
</ol>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini digunakan untuk menghapus database MySQL, format penggunaannya :</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>mysql_drop_db</strong>(<em>database [,pengenal hubungan]</em>)</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify"><strong>Argumen</strong></p>
<ul>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><em>pengenal_hubungan</em> adalah pengenal/variable yang diperoleh pada fungsi <strong>mysql_connect</strong></p>
</li>
<li>
<p class="western" style="margin-bottom:0;" align="justify">database 	adalah database yang akan dihapus</p>
</li>
</ul>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini mengembalikan nilai TRUE jika berhasil dan FALSE jika gagal</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<ol>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><strong>Fungsi 	mysql_list_dbs</strong></p>
</li>
</ol>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini berguna untuk menghasilkan daftar database <strong>MySQL</strong>, format pemanggilannya:</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>mysql_list_dbs</strong>(<em>[pengenal_hubungan]</em>)</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify"><strong>Argumen</strong></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><em>pengenal_hubungan</em> adalah pengenal/variable yang diperoleh pada fungsi <strong>mysql_connect</strong></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Hasil berupa pointer yang menunjuk daftar databse</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify"><strong>Contoh</strong></p>
<dl>
<dd>
<table id="tias983" border="1" cellspacing="0" cellpadding="8" width="534"><col width="516"></col></p>
<tbody>
<tr>
<td width="516" valign="top">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">Menampilkan 				Daftar Database</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">&#60;?php</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$pemakai  = 				"php";</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$password = 				"pinguin";</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$id_mysql = 				mysql_connect("localhost",</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$pemakai,</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$password);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if 				(! $id_mysql)</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">die("Database 				MySQL tak dapat dibuka");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$hasil = 				mysql_list_dbs($id_mysql);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">while ( $db = 				mysql_fetch_row($hasil) )</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">{</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">print("Database: 				$db[0]<br />
n");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">}</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">mysql_close($id_mysql);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">?&#62;</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
</td>
</tr>
</tbody>
</table>
</dd>
</dl>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<ol>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><strong>Fungsi 	mysql_list_tables</strong></p>
</li>
</ol>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini berguna untuk memperoleh daftar nama tabel dalam suatu database. Format pemanggilannya:</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>mysql_list_tables</strong>(<em>database, [pengenal_hubungan]</em>)</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Argumen</p>
<ul>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><em>pengenal_hubungan</em> adalah pengenal/variable yang diperoleh pada fungsi <strong>mysql_connect</strong></p>
</li>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><em>database</em> adalah nama database MySQL</p>
</li>
</ul>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">hasil berupa pointer yang dapat diakases melalui perintah mysql_fetch_row</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<dl>
<dd>
<table id="tias1088" border="1" cellspacing="0" cellpadding="8" width="525"><col width="507"></col></p>
<tbody>
<tr>
<td width="507" valign="top">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">Menampilkan 				Daftar Database</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">&#60;?php</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$pemakai  = 				"php";</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$password = 				"pinguin";</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$id_mysql = 				mysql_connect("localhost",</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$pemakai,</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$password);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if 				(! $id_mysql)</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">die("Database 				MySQL tak dapat dibuka");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$hasil = 				mysql_list_dbs($id_mysql);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">while ( $db = 				mysql_fetch_row($hasil) )</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">{</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">print("Database: 				$db[0]<br />
n");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// Menampilkan 				nama-nama tabel</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$hasil_tabel = 				mysql_list_tables($db[0]);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">while 				($nama_tabel = mysql_fetch_row(</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$hasil_tabel))</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">{</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">print("---Tabel 				: $nama_tabel[0]<br />
n");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">}</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">}</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">mysql_close($id_mysql);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">?&#62;</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
</td>
</tr>
</tbody>
</table>
</dd>
</dl>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<ol>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><strong>Fungsi 	mysql_list_fields</strong></p>
</li>
</ol>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Fungsi ini berguna untuk memperoleh daftar nama kolom dalam suatu database. Format pemanggilannya:</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify"><strong>mysql_list_field</strong>(<em>database, nama_tabel [,pengenal_hubungan]</em>)</p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify"><strong>Argumen</strong></p>
<ul>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><em>pengenal_hubungan</em> adalah pengenal/variable yang diperoleh pada fungsi <strong>mysql_connect</strong></p>
</li>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><em>database</em> adalah nama database yang diperoleh dari fungsi <strong>mysql_list_dbs</strong></p>
</li>
<li>
<p class="western" style="margin-bottom:0;" align="justify"><em>nama_tabel</em> adalah string yang diperoleh dari <strong>mysql_list_tables</strong></p>
</li>
</ul>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;" align="justify">hasil berupa suatu pointer yang dapat diakses melalui fungsi seperti <strong>mysql_field_name</strong> dan <strong>mysql_field_type.</strong></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<dl>
<dd>
<table id="tias1224" border="1" cellspacing="0" cellpadding="8" width="534"><col width="516"></col></p>
<tbody>
<tr>
<td width="516" valign="top">
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">Menampilkan 				Daftar Database</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">&#60;?php</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$pemakai  = 				"php";</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$password = 				"pinguin";</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$id_mysql = 				mysql_connect("localhost",</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$pemakai,</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$password);</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if 				(! $id_mysql)</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">die("Database 				MySQL tak dapat dibuka");</span></span></p>
<p class="western" style="margin-bottom:0;">
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$hasil = 				mysql_list_dbs($id_mysql);</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">while ( $db = 				mysql_fetch_row($hasil) )</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">{</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">print("Database: 				$db[0]<br />
n");</span></span></p>
<p class="western" style="margin-bottom:0;">
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// 				Menampilkan nama-nama tabel</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$hasil_tabel = 				mysql_list_tables($db[0]);</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">while 				($nama_tabel = mysql_fetch_row(</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$hasil_tabel))</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">{</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">print("---Tabel 				: $nama_tabel[0]<br />
n");</span></span></p>
<p class="western" style="margin-bottom:0;">
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// Menampilkan 				nama-nama kolom</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$hasil_field = 				mysql_list_fields(</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$db[0],</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$nama_tabel[0]);</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$jum_kolom = 				mysql_num_fields($hasil_field);</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">for($i = 0; $i &#60; 				$jum_kolom; $i++)</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">{</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$nama = 				mysql_field_name($hasil_field, $i);</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">print("****** 				Kolom : $nama<br />
n");</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">}</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">}</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">}</span></span></p>
<p class="western" style="margin-bottom:0;">
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">mysql_close($id_mysql);</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">?&#62;</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western"><span style="font-family:Courier New,monospace;"></span></p>
</td>
</tr>
</tbody>
</table>
</dd>
</dl>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;">
<p style="margin-left:0.5in;margin-bottom:0;">
<p style="margin-left:0.5in;margin-bottom:0;"><strong>Koneksi PHP MySQL </strong></p>
<p style="margin-left:0.5in;margin-bottom:0;">Pada umumnya Untuk membuka koneksi dengan MySQL adalah sebahai berikut :</p>
<p class="western" style="margin-bottom:0;">
<dl>
<dd>
<table id="tias1367" border="1" cellspacing="0" cellpadding="8" width="540"><col width="522"></col></p>
<tbody>
<tr>
<td width="522" valign="top">
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">&#60;?php<br />
// configurasi 				database MySQL<br />
$dbhost = 'localhost'; //Nama 				komputer tempat MySQL<br />
$dbuser = 'root'; //Nama User 				MySQL<br />
$dbpass = 'password'; //Password dari pasangan 				User<br />
$dbname = 'somedatabase'; // Nama Database</span></span></p>
<p class="western" style="margin-bottom:0;">
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// Koneksi 				ke 				MySQL<br />
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Gagal 				membuka koneksi ke MySQL Server');<br />
mysql_select_db($dbname);</span></span></p>
<p class="western" style="margin-bottom:0;">
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">//</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">.. 				program inti</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">//</span></span></p>
<p class="western" style="margin-bottom:0;">
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">//menutup 				koneksi ke MySQL</span></span></p>
<p class="western"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">mysql_close($conn);<br />
?&#62;</span></span></td>
</tr>
</tbody>
</table>
</dd>
</dl>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify"><strong>CONTOH PROGRAM</strong></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">Counter pengunjung menggunakan <strong>MySQL</strong>, sebelum anda membuat programnya buat tabel dengan nama <em>counter</em> dan field <em>pencacah</em> dengan type <em>BIGINT</em></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;page-break-after:avoid;" align="justify"><strong>Counter.php</strong></p>
<dl>
<dd>
<table id="tias1424" border="1" cellspacing="0" cellpadding="8" width="534"><col width="516"></col></p>
<tbody>
<tr>
<td width="516" valign="top">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">Contoh 				Counter Menggunakan MySQL</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">&#60;?php</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$pemakai  = 				"php";</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$password = 				"pinguin";</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$database = 				"test";</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$id_mysql = 				mysql_connect("localhost",</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$pemakai,</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$password);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if 				(! $id_mysql)</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">die("Database 				MySQL tak dapat dibuka");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// 				Mengunci tabel counter</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$hasil = 				mysql_db_query($database,</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">"LOCK 				TABLES counter WRITE",</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$id_mysql);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if 				(! $hasil)</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">die("Permintaan 				gagal dilaksanakan");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// 				Membaca nilai pencacah</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$hasil = 				mysql_db_query($database,</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">"SELECT 				* FROM counter",</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$id_mysql);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$data = 				mysql_fetch_row($hasil);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$pencacah = 				$data[0];</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// 				Naikkan pencacah</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$pencacah++;</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// 				Simpan nilai pencacah ke tabel counter</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$perintah_update 				=</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">"UPDATE 				counter SET pencacah = $pencacah";</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$hasil = 				mysql_db_query($database,</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$perintah_update,</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$id_mysql);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// 				Bebaskan penguncian</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$hasil = 				mysql_db_query($database,</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">"UNLOCK 				TABLES",</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$id_mysql);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// 				Tutup hubungan ke MySQL</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">mysql_close($id_mysql);</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// 				Tampilkan</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">print("Anda 				adalah pengunjung ke-$pencacah");</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">?&#62;</span></span></p>
<p class="western" style="margin-bottom:0;" align="justify">
<p class="western" style="margin-bottom:0;" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" align="justify"><span style="font-family:Courier New,monospace;"></span></p>
</td>
</tr>
</tbody>
</table>
</dd>
</dl>
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p class="western" style="margin-left:0.5in;margin-bottom:0;" align="justify">
<p style="margin-left:0.5in;margin-bottom:0;">Berikut adalah contoh program aplikasi guesbook, pada contoh ini antara form untuk input data, simpan data dan untuk membaca data yang telah tersimpan dalam tabel, digabung menjadi satu program, tapi sebelumnya buat dulu tabel guesbook dengan skrip sebaai berikut :</p>
<p style="margin-bottom:0;">
<dl>
<dd>
<table id="tias1597" border="1" cellspacing="0" cellpadding="8" width="575"><col width="557"></col></p>
<tbody>
<tr>
<td width="557" valign="top">
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">CREATE 				TABLE guestbook (</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">id 				INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">name 				VARCHAR(30) NOT NULL,</span></span></p>
<p style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">email 				VARCHAR(50) NOT NULL,</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">url 				VARCHAR(50) NULL,</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">message 				TEXT NOT NULL,</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">entry_date 				DATE NOT NULL,</span></span></p>
<p class="western" style="margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">PRIMARY 				KEY(id)</span></span></p>
<p class="western"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">);</span></span></p>
</td>
</tr>
</tbody>
</table>
</dd>
</dl>
<p style="margin-bottom:0;">
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><strong>Guestbook.php</strong></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;">
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">&#60;?php</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$dbhost = 'localhost'; </span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$dbuser = 'root'; </span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$dbpass = 'puskom';</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$dbname = 'webphp';</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;">
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Gagal membuka koneksi ke MySQL Server');</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">mysql_select_db($dbname);</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;">
<p class="western" style="margin-left:0.5in;margin-bottom:0;">
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// cek apakah button submit ditekan</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if(isset($_POST['btnSign']))</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">{</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// mendapatkan variabel pada form</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;">
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$name    = trim($_POST['txtName']);</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$email   = trim($_POST['txtEmail']);</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$url     = trim($_POST['txtUrl']);</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$message = trim($_POST['mtxMessage']);</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;">
<p class="western" style="margin-left:0.5in;margin-bottom:0;">
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if(!get_magic_quotes_gpc())</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">{</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$name    = addslashes($name);</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$message = addslashes($message);</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">}</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;">
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// jika url kosong isi dengan string kosong </span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if ($url == 'http://')</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">{</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$url = '';</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">}</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;">
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// query string</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$query = "INSERT INTO guestbook (name, email, url, message, entry_date) " .</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">"VALUES ('$name', '$email', '$url', '$message', current_date)";</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;">
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// mengeksekusi query untuk menambah data </span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">mysql_query($query) or die('Error, terjadi kesalahan. ' . mysql_error());</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;">
<p class="western" style="margin-left:0.5in;margin-bottom:0;">
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">header('Location: ' . $_SERVER['REQUEST_URI']);</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;">
<p class="western" style="margin-left:0.5in;margin-bottom:0;">
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">exit;</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">}</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">?&#62;</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">Guestbook</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">/*</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">fungsi validasi data form</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">*/</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">function checkForm()</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">{</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;">
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">var gname, gemail, gurl, gmessage;</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">with(window.document.guestform)</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">{</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">gname    = txtName;</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">gemail   = txtEmail;</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">gurl     = txtUrl;</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">gmessage = mtxMessage;</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">}</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;">
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// peringatan jika nama kosong </span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">if(trim(gname.value) == '')</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">{</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">alert('Maukan Nama anda ');</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">gname.focus();</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">return false;</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">}</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// peringatan jika email kosong atau format salah </span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">else if(trim(gemail.value) != '' &#38;&#38; !isEmail(trim(gemail.value)))</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">{</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">alert('Masukan email anda dengan benar');</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">gemail.focus();</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">return false;</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">}</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// peringatan jika pesan kosong</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">else if(trim(gmessage.value) == '')</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">{</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">alert('Masukan Pesan Anda');</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">gmessage.focus();</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">return false;</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">}</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">else</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">{</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;">
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">return true;</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">}</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">}</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;">
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">/*</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">Fungsi untuk menghilangkan spasi</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">*/</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">function trim(str)</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">{</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">return str.replace(/^s+&#124;s+$/g,'');</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">}</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;">
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">/*</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">fungsi untuk mencek format email</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">*/</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">function isEmail(str)</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">{</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">var regex = /^[-_.a-z0-9]+@(([-a-z0-9]+.)+(ad&#124;ae&#124;aero&#124;af&#124;ag&#124;ai&#124;al&#124;am&#124;an&#124;ao&#124;aq&#124;ar&#124;arpa&#124;as&#124;at&#124;au&#124;aw&#124;az&#124;ba&#124;bb&#124;bd&#124;be&#124;bf&#124;bg&#124;bh&#124;bi&#124;biz&#124;bj&#124;bm&#124;bn&#124;bo&#124;br&#124;bs&#124;bt&#124;bv&#124;bw&#124;by&#124;bz&#124;ca&#124;cc&#124;cd&#124;cf&#124;cg&#124;ch&#124;ci&#124;ck&#124;cl&#124;cm&#124;cn&#124;co&#124;com&#124;coop&#124;cr&#124;cs&#124;cu&#124;cv&#124;cx&#124;cy&#124;cz&#124;de&#124;dj&#124;dk&#124;dm&#124;do&#124;dz&#124;ec&#124;edu&#124;ee&#124;eg&#124;eh&#124;er&#124;es&#124;et&#124;eu&#124;fi&#124;fj&#124;fk&#124;fm&#124;fo&#124;fr&#124;ga&#124;gb&#124;gd&#124;ge&#124;gf&#124;gh&#124;gi&#124;gl&#124;gm&#124;gn&#124;gov&#124;gp&#124;gq&#124;gr&#124;gs&#124;gt&#124;gu&#124;gw&#124;gy&#124;hk&#124;hm&#124;hn&#124;hr&#124;ht&#124;hu&#124;id&#124;ie&#124;il&#124;in&#124;info&#124;int&#124;io&#124;iq&#124;ir&#124;is&#124;it&#124;jm&#124;jo&#124;jp&#124;ke&#124;kg&#124;kh&#124;ki&#124;km&#124;kn&#124;kp&#124;kr&#124;kw&#124;ky&#124;kz&#124;la&#124;lb&#124;lc&#124;li&#124;lk&#124;lr&#124;ls&#124;lt&#124;lu&#124;lv&#124;ly&#124;ma&#124;mc&#124;md&#124;mg&#124;mh&#124;mil&#124;mk&#124;ml&#124;mm&#124;mn&#124;mo&#124;mp&#124;mq&#124;mr&#124;ms&#124;mt&#124;mu&#124;museum&#124;mv&#124;mw&#124;mx&#124;my&#124;mz&#124;na&#124;name&#124;nc&#124;ne&#124;net&#124;nf&#124;ng&#124;ni&#124;nl&#124;no&#124;np&#124;nr&#124;nt&#124;nu&#124;nz&#124;om&#124;org&#124;pa&#124;pe&#124;pf&#124;pg&#124;ph&#124;pk&#124;pl&#124;pm&#124;pn&#124;pr&#124;pro&#124;ps&#124;pt&#124;pw&#124;py&#124;qa&#124;re&#124;ro&#124;ru&#124;rw&#124;sa&#124;sb&#124;sc&#124;sd&#124;se&#124;sg&#124;sh&#124;si&#124;sj&#124;sk&#124;sl&#124;sm&#124;sn&#124;so&#124;sr&#124;st&#124;su&#124;sv&#124;sy&#124;sz&#124;tc&#124;td&#124;tf&#124;tg&#124;th&#124;tj&#124;tk&#124;tm&#124;tn&#124;to&#124;tp&#124;tr&#124;tt&#124;tv&#124;tw&#124;tz&#124;ua&#124;ug&#124;uk&#124;um&#124;us&#124;uy&#124;uz&#124;va&#124;vc&#124;ve&#124;vg&#124;vi&#124;vn&#124;vu&#124;wf&#124;ws&#124;ye&#124;yt&#124;yu&#124;za&#124;zm&#124;zw)&#124;(([0-9][0-9]?&#124;[0-1][0-9][0-9]&#124;[2][0-4][0-9]&#124;[2][5][0-5]).){3}([0-9][0-9]?&#124;[0-1][0-9][0-9]&#124;[2][0-4][0-9]&#124;[2][5][0-5]))$/i;</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">return regex.test(str);</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">}</span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"></p>
<table border="0" cellspacing="1" cellpadding="2" width="550">
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><br />
</span></span></p>
<tbody>
<tr>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> </span></span></span></span></p>
<td width="100">Name *</td>
<td>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
</td>
<p><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"></span></span></span></p>
</tr>
<p><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><br />
</span></span></span></span></p>
<tr>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> </span></span></span></span></span></span></p>
<td width="100">Email</td>
<p><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> </span></span></span></span></span></span></p>
<td>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
</td>
<p><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"></span></span></span></span></span></p>
</tr>
<p><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><br />
</span></span></span></span></span></span></p>
<tr>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> </span></span></span></span></span></span></span></span></p>
<td width="100">Website URL</td>
<p><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> </span></span></span></span></span></span></span></span></p>
<td>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
</td>
<p><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"></span></span></span></span></span></span></span></p>
</tr>
<p><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><br />
</span></span></span></span></span></span></span></span></p>
<tr>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> </span></span></span></span></span></span></span></span></span></span></p>
<td width="100">Message *</td>
<td>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
</td>
<p><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"></span></span></span></span></span></span></span></span></span></p>
</tr>
<p><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><br />
</span></span></span></span></span></span></span></span></span></span></p>
<tr>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> </span></span></span></span></span></span></span></span></span></span></span></span></p>
<td width="100"></td>
<p><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"></span></span></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> </span></span></span></span></span></span></span></span></span></span></span></span></p>
<td>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"></span></p>
</td>
<p><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"></span></span></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"></span></span></span></span></span></span></span></span></span></span></span></p>
</tr>
<p><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"></span></span></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"></span></span></span></span></span></span></span></span></span></span></span></p>
</tbody>
</table>
<p></span></span></p>
<p><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"></span></span></span></span></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"></span></span></span></span></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><br />
</span></span></span></span></span></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><br />
</span></span></span></span></span></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">&#60;?php</span></span></span></span></span></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><br />
</span></span></span></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><br />
</span></span></span></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// =======================</span></span></span></span></span></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// menampilkan daftar guest book</span></span></span></span></span></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">// =======================</span></span></span></span></span></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><br />
</span></span></span></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">//maximal baris</span></span></span></span></span></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$rowsPerPage = 10;</span></span></span></span></span></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><br />
</span></span></span></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><br />
</span></span></span></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"> <span style="font-family:Courier New,monospace;"><span style="font-size:x-small;">$pageNum = 1;</span></span></span></span></span></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><br />
</span></span></span></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><span style="font-family:Courier New,monospace;"><span style="font-size:x-small;"><br />
</span></span></span></span></span></span></span></span></span></span></span></span></p>
<p class="western" style="margin-left:0.5in;margin-bottom:0;