Jumat, 16 November 2012

Membuat Website Itu Mudah mengunakan Fremset

Frameset adalah salah satu cara untuk membagi-bagi halaman ke dalam beberapa bagian. Pekerjaan merancang halaman dengan memanfaatkan frameset menjadi pekerjaan yang mudah. Bagian-bagian utama pada website dapat dikelompokkan ke dalam frame, sedangkan bagian contentnya tetap berada di frame yang akan selalu berubah. Dengan demikian, kita dapat menentukan bagian mana yang akan menjadi kepala halaman (header), menu, kaki, content, dan bagian lain yang dianggap perlu. Frameset berbeda dengan halaman HTML biasa, di dalam halaman frameset hanya terdapat pengaturan mengenai bagaimana sebuah halaman ditata (layout halaman). Pada halaman frameset ini, dapat ditampilkan beberapa halaman HTML sekaligus pada jendela web browser yang sama. Halaman-halaman HTML yang ditampilkan dalam frameset tersebut menempati bagiannya masing-masing, dan setiap frame dalam frameset tidak saling berkaitan satu dengan lainnya. Pada halaman yang panjang, scrolling hanya berlaku pada frame itu saja – biasanya scrolling hanya diberlakukan pada frame content saja. Dengan adanya frameset, pengelolaan halaman menjadi mudah, namun jumlah file yang harus dikelola menjadi bertambah. Hal ini menjadi menyulitkan bagi yang belum terbiasa, mengingat perancang harus bekerja dengan beberapa dokumen HTML sekaligus. Pembuatan halaman frameset menggunakan dua tag HTML, yaitu Tag dan Tag , penjelasannya adalah sebagai berikut: Tag Frameset Tag digunakan untuk mendefinisikan bagaimana jendela web browser akan dibagi menjadi frame-frame yang lebih kecil. Tag ini dituliskan untuk membagi-bagi halaman ke dalam format baris dan kolom yang akan diisi dengan frame. Nilai baris atau kolom menentukan jumlah area layar yang akan digunakan oleh setiap baris atau kolom. Pada frame-frame tersebut ditempatkan halaman-halaman HTML. Satu halaman HTML akan menempati satu frame. Tag berikut akan membagi layar menjadi tiga bagian kolom masing-masing lebarnya sebesar 25%, 50%, dan 25% dari lebar keseluruhan area layar. Layout halaman frameset di atas akan tampak seperti di bawah ini: frame 1 – 25% frame 2 – 50% frame 3 – 25% Tag berikut akan membagi layar menjadi tiga bagian baris masing-masing tingginya sebesar 25%, 50%, dan 25% dari tinggi keseluruhan area layar. Layout halaman frameset di atas akan tampak seperti di bawah ini : frame 1 – 25% frame 2 – 50% frame 3 – 25% Pembagian frame bisa dengan ukuran persentase (relatif) seperti contoh di atas, atau dengan ukuran pixel (absolut). Namun dengan pixel tidak dapat ditentukan ukuran seluruh frame, karena ukuran layar monitor yang digunakan juga belum tentu sama. Untuk itu digunakan tanda “*” untuk pengganti ukuran yang tidak tentu tadi. Contoh berikut akan membagi layar menjadi dua bagian baris masing-masing sebesar 100 pixel dan sisa pixel dari tinggi area layar. Layout halaman frameset di atas akan tampak seperti di bawah ini : frame 1 – 100 px frame 2 – fleksibel Sedangkan contoh ini akan membagi layar menjadi dua bagian kolom masing-masing sebesar 100 pixel dan sisa pixel dari lebar area layar. Layout halaman frameset di atas akan tampak seperti di bawah ini : frame 1 100 px frame 2 fleksibel Tag tidak membutuhkan adanya tag kecuali bila web browser yang digunakan tidak mendukung tag tersebut. Tag Frame Tag dituliskan untuk menempatkan dokumen HTML yang akan disertakan pada frame. Pada contoh berikut, frameset membagi halaman menjadi dua kolom, masing-masing lebar kolom adalah 25% dan 75% dari lebar area layar. Dokumen HTML dengan nama “frame_1.html” ditempatkan pada kolom pertama, dan dokumen HTML kedua bernama “frame_2.html” disertakan pada kolom kedua. Frameset Vertikal Nah, sekarang kita coba membuat sebuah halaman website dengan frameset. Jalankan aplikasi Notepad. Klik Start > Programs > Accessories > Notepad. Kemudian ketik baris perintah berikut ini : Simpan file di My Documents sebagai “frameset-01.html” dengan cara klik menu File-Save As.. Di sebelah kiri pilih My Documents, kemudian pada bagian Save as type pilih All Files, lalu ketik “frameset-01.html” pada bagian File name, klik tombol Save. Jalankan aplikasi Explorer, klik My Documents, cari file “frameset-01.html” yang baru dibuat tadi, kemudian klik ganda file tersebut. Jendela Internet Browser akan terbuka, memperlihatkan isi halaman frameset-01.html. <– 20% –> <———– 60% ———–> <– 20% –> Penjelasan Contoh latihan di atas memperlihatkan bagaimana cara membuat frame dengan tiga kolom vertikal masing-masing selebar 20%, 60%, dan 20% dari lebar area layar. Frame pertama berisi “frame_1.html”, frame kedua berisi “frame_2.html”, dan frame ketiga berisi “frame_3.html”.Frameset dengan menggunakan nilai persen tidak memiliki ukuran piksel yang pasti, lebar frameset ini akan mengikuti lebar layar dan dihitung sebagai persentase dari lebar layar. Frameset Horizontal Sekarang kita coba lagi membuat sebuah halaman website dengan frameset horizontal. Jalankan aplikasi Notepad. Klik Start > Programs > Accessories > Notepad. Kemudian ketik baris perintah berikut ini : Simpan file di My Documents sebagai “frameset-02.html” dengan cara klik menu File-Save As.. Di sebelah kiri pilih My Documents, kemudian pada bagian Save as type pilih All Files, lalu ketik “frameset-02.html” pada bagian File name, klik tombol Save. Jalankan aplikasi Explorer, klik My Documents, cari file “frameset-02.html” yang baru dibuat tadi, kemudian klik ganda file tersebut. Jendela Internet Browser akan terbuka, memperlihatkan isi halaman frameset-02.html. | 200 pixel | | | | | * pixel (sisa dari tinggi layar) | | | | 100 pixel Penjelasan Contoh latihan di atas memperlihatkan bagaimana cara membuat frameset dengan tiga baris horizontal masing-masing tingginya sebesar 200 pixel, * pixel (sisa tinggi dari tinggi layar), dan 100 pixel. Frame pertama berisi “frame_1.html”, frame kedua berisi “frame_2.html”, dan frame ketiga berisi “frame_3.html”. Perhatikan bahwa frameset ini menggunakan frame yang tetap (frame 1 = 200pixel, frame 3 = 100 pixel) dan frame yang fleksibel ditandai dengan tanda asterik (*). Frame yang tetap akan memiliki ukuran yang pasti dalam hitungan piksel, tapi frame yang fleksibel memiliki ukuran sebagai sisa dari ukuran layar dikurangi oleh ukuran frame-frame tetap. Tag Noframes Selain Tag Frameset dan Tag Frame, di dalam halaman frameset juga harus ada Tag Noframes. Format penulisannya adalah sebagai berikut: Jalankan aplikasi Notepad. Klik Start-Programs-Accessories-Notepad. Ketik baris perintah berikut ini : <body>Web browser tidak mendukung frame!</body> Simpan file sebagai “frameset-03.html” Jalankan aplikasi Explorer, cari file “frameset-03.html” yang baru dibuat tadi di My Documents, kemudian klik ganda untuk membuka file tersebut. Jendela Internet Browser akan segera terbuka mempelihatkan isi file html tersebut. Penjelasan Contoh latihan di atas memperlihatkan bagaimana tag dibuat. Tag noframes ini akan bekerja dan menampilkan isi tag <body> jika internet browser yang digunakan tidak mendukung frameset. Frameset Kombinasi Layout halaman HTML dapat dibuat sederhana dengan membaginya menjadi beberapa baris (rows). Kemudian, pada salah satu rows, kita dapat membaginya menjadi beberapa kolom. Hal ini sering dilakukan untuk mendapatkan layout halaman HTML yang optimal. Sekarang kita coba untuk membuat layout halaman kombinasi tersebut. Jalankan aplikasi Notepad. Klik Start-Programs-Accessories-Notepad. Ketik baris perintah berikut ini : <html> <frameset rows="150,*"> <frame src="frame_1.html"> <frameset cols="20%,80%"> <frame src="frame_2.html"> <frame src="frame_3.html"> </frameset> </frameset> </html> Simpan file sebagai &#8220;frameset-04.html&#8221; Jalankan aplikasi Explorer, cari file &#8220;frameset-04.html&#8221; yang baru dibuat tadi di My Documents, kemudian klik ganda untuk membuka file tersebut. Jendela Internet Browser akan segera terbuka mempelihatkan isi file html tersebut. | 150pixel | <&#8211; 20% &#8211;> < &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- 80% &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;> Penjelasan Contoh latihan di atas memperlihatkan cara membuat frameset kombinasi. Tag <frameset> yang pertama akan membagi layar menjadi dua frame horizontal, frame pertama di bagian atas tingginya 150 pixel dan frame kedua di bagian bawah tingginya adalah sisa pixel dari tinggi area layar. Kemudian tag <frameset> kedua akan membagi frame kedua (frame yang berada di bawah) menjadi dua frame vertikal, masing-masing sebesar 20% dan 80% dari lebar area layar. Frameset dengan Scrolling dan Noresize Layout halaman HTML ditampilkan oleh Browser sesuai dengan ukuran yang dituliskan. Jika isi frameset tersebut, yang disimpan dalam file HTML lebih besar ukurannya daripada ukuran frame yang disediakan, maka secara otomatis browser akan menampilkan scroll bar. Sekarang kita coba untuk membuat layout halaman dengan scrolling dan tanpa scrolling. Jalankan aplikasi Notepad. Klik Start-Programs-Accessories-Notepad. Ketik baris perintah berikut ini : <html><frameset rows=&#8221;150,*&#8221;> <frame scrolling=&#8221;No&#8221; src=&#8221;frame_1.html&#8221;> <frameset cols=&#8221;25%,75%&#8221;> <frame scroling=&#8221;No&#8221; noresize=&#8221;noresize&#8221; src=&#8221;frame_2.html&#8221;> <frame noresize=&#8221;noresize&#8221; src=&#8221;frame_3.html&#8221;> </frameset> </frameset> </html> Simpan file sebagai &#8220;frameset-05.html&#8221; Jalankan aplikasi Explorer, cari file &#8220;frameset-05.html&#8221; yang baru dibuat tadi di My Documents, kemudian klik ganda untuk membuka file tersebut. Jendela Internet Browser akan segera terbuka mempelihatkan isi file html tersebut. Penjelasan Contoh latihan di atas mendemonstrasikan bagaimana atribut NORESIZE menyebabkan batas pinggiran antar frame tidak dapat digeser. Frame Navigasi Jalankan aplikasi Notepad. Klik Start-Programs-Accessories-Notepad. Ketik baris perintah berikut ini : <html><body> <a href=&#8221;frame_1.html&#8221; target=&#8221;showframe&#8221;>Frame 1</a><br> <a href=&#8221;frame_2.html&#8221; target=&#8221;showframe&#8221;>Frame 2</a><br> <a href=&#8221;frame_3.html&#8221; target=&#8221;showframe&#8221;>Frame 3</a> </body> </html> Simpan file sebagai &#8220;frame-6a.html&#8221; Ketik baris perintah berikut ini : <html><frameset cols=&#8221;120,*&#8221;> <frame src=&#8221;frame-6a.html&#8221;> <frame src=&#8221;frame_1.html&#8221; name=&#8221;showframe&#8221;> </frameset> </html> Simpan file sebagai &#8220;frameset-06.html&#8221; Jalankan aplikasi Explorer, cari file &#8220;frameset-06.html&#8221; yang baru dibuat tadi di My Documents, kemudian klik ganda untuk membuka file tersebut. Jendela Internet Browser akan segera terbuka mempelihatkan isi file html tersebut. Frame 1Frame 2 Frame 3 <showframe> Penjelasan Contoh latihan di atas memperlihatkan penggunaan frame untuk memudahkan navigasi sebuah halaman Web. Untuk itu diperlukan sebuah dokumen HTML berisi link yang berfungsi sebagai navigasi pada satu frame, dan frame lainnya akan digunakan sebagai target dokumen yang ditunjukkan pada link-link tersebut. Pada contoh di atas, file frame-6a.html berisi tiga buah link yang bila diklik akan dibuka pada frame bernama &#8220;showframe&#8221;, hal ini dapat dilihat dari penggunaan atribut TARGET=SHOWFRAME. Sedangkan file frameset-06.html berisi <frameset> yang membagi layar menjadi dua bagian, dan salah satu framenya diberi atribut NAME=SHOWFRAME. Pada frame inilah link-link dokumen yang ada pada file frame-6a.html akan terbuka. Catatan: Pada contoh di atas, Anda diminta untuk menyiapkan halaman-halaman HTML sebagai frameset. Untuk itu, Anda dapat menyiapkan file-file: frameset-01.html, frameset-02.html, frameset-03.html, frameset-04.html, frameset-05.html, frameset-06.html seperti yang diminta. Sebagaimana telah diuraikan di atas, frameset dipergunakan untuk layout halaman saja. File yang mengisi masing-masing bagian pada frameset diletakkan pada file yang terpisah. Dalam hal ini ada beberapa file lain yang perlu disiapkan, yaitu : frame_1.html, frame_2.html, frame_3.html. Sebagai contoh, Anda dapat menyiapkan frame_1.html dalam bentuk yang sederhana, misalnya sebagai berikut : <html> <head> <title>Frame 1 - Header</title> </head> <body bgcolor="#3399FF"> <div align="center">FRAME 1 - HEADER</div> </body> </html> Siapkan juga file frame_2.html, misalnya sebagai berikut : <html> <head> <title>Frame 2</title> </head> <body bgcolor="#009966"> <div align="center">FRAME 2</div> </body> </html> Dan file frame_3.html, misalnya sebagai berikut : <html> <head> <title>Frame 3</title> </head> <body bgcolor="#FFFFCC"> <div align="center">FRAME 3</div> </body> </html> Simpan ketiga file tambahan ini pada folder yang sama dengan file-file frameset (frameset-01.html, frameset-02.html, frameset-03.html, frameset-04.html, frameset-05.html, frameset-06.html). Tentu saja dengan format .html seperti biasa. Dengan demikian, maka file frameset akan menyertakan file frame_1.html, frame_2.html, frame_3.html ke dalam frame yang dibentuknya. <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'><span class='post-author vcard'> Diposting oleh <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'> <meta content='https://www.blogger.com/profile/15869231707966236211' itemprop='url'/> <a href='https://www.blogger.com/profile/15869231707966236211' rel='author' title='author profile'> <span itemprop='name'>Unknown</span> </a> </span> </span> <span class='post-timestamp'> di <meta content='https://loebizpiss.blogspot.com/2012/11/membuat-website-itu-mudah-mengunakan.html' itemprop='url'/> <a class='timestamp-link' href='https://loebizpiss.blogspot.com/2012/11/membuat-website-itu-mudah-mengunakan.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2012-11-16T12:49:00-08:00'>12.49</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://loebizpiss.blogspot.com/2012/11/membuat-website-itu-mudah-mengunakan.html#comment-form' onclick=''> Tidak ada komentar: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-80050670'> <a href='https://www.blogger.com/post-edit.g?blogID=3945660030349696922&postID=8300381814556955207&from=pencil' title='Edit Entri'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=3945660030349696922&postID=8300381814556955207&target=email' target='_blank' title='Kirimkan Ini lewat Email'><span class='share-button-link-text'>Kirimkan Ini lewat Email</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=3945660030349696922&postID=8300381814556955207&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=3945660030349696922&postID=8300381814556955207&target=twitter' target='_blank' title='Bagikan ke X'><span class='share-button-link-text'>Bagikan ke X</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=3945660030349696922&postID=8300381814556955207&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Berbagi ke Facebook'><span class='share-button-link-text'>Berbagi ke Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=3945660030349696922&postID=8300381814556955207&target=pinterest' target='_blank' title='Bagikan ke Pinterest'><span class='share-button-link-text'>Bagikan ke Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'><span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'><span class='post-location'> </span> </div> </div> </div> </div> </div></div> <div class="date-outer"> <h2 class='date-header'><span>Jumat, 09 November 2012</span></h2> <div class="date-posts"> <div class='post-outer'> <div class='post hentry' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='3945660030349696922' itemprop='blogId'/> <meta content='8818574323812054850' itemprop='postId'/> <a name='8818574323812054850'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://loebizpiss.blogspot.com/2012/11/manipulasi-data-mysql-dengan-php-select_9.html'>manipulasi data mysql dengan php - select insert update delete data mysql</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-8818574323812054850' itemprop='description articleBody'> <div class="codeheader"> Kode: <a class="codeoperation" href="//www.blogger.com/blogger.g?blogID=3945660030349696922">[Pilih]</a></div> <pre style="margin: 0; padding: 0;"><code class="bbc_code">create database universitas; use universitas; CREATE TABLE IF NOT EXISTS `mahasiswa` ( &nbsp; `nim` char(9) NOT NULL, &nbsp; `nama` varchar(50) NOT NULL, &nbsp; `tgl_lahir` date NOT NULL, &nbsp; `alamat` varchar(200) NOT NULL, &nbsp; `email` varchar(50) NOT NULL, &nbsp; PRIMARY KEY (`nim`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;</code></pre> kalo udah bikin databasenya kita buat file koneksinya deh, kaya di bawah ini<br /><div class="codeheader"> Kode: <a class="codeoperation" href="//www.blogger.com/blogger.g?blogID=3945660030349696922">[Pilih]</a></div> <pre style="margin: 0; padding: 0;"><code class="bbc_code"><span style="color: black;"><span style="color: #0000bb;">&lt;?php $host</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'nama_host'</span><span style="color: #007700;">]&nbsp;=&nbsp;</span><span style="color: #dd0000;">'localhost'</span><span style="color: #007700;">;</span><span style="color: #0000bb;">$user</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'nama_user'</span><span style="color: #007700;">]&nbsp;=&nbsp;</span><span style="color: #dd0000;">'root'</span><span style="color: #007700;">;</span><span style="color: #0000bb;">$pass</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'password_user'</span><span style="color: #007700;">]&nbsp;=&nbsp;</span><span style="color: #dd0000;">''</span><span style="color: #007700;">;</span><span style="color: #0000bb;">$db</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'nama_datbase'</span><span style="color: #007700;">]&nbsp;=&nbsp;</span><span style="color: #dd0000;">'universitas'</span><span style="color: #007700;">; </span><span style="color: #0000bb;">$koneksi&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #0000bb;">mysql_connect&nbsp;</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$host</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'nama_host'</span><span style="color: #007700;">],</span><span style="color: #0000bb;">$user</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'nama_user'</span><span style="color: #007700;">],</span><span style="color: #0000bb;">$pass</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'password_user'</span><span style="color: #007700;">]); if(&nbsp;!&nbsp;</span><span style="color: #0000bb;">$koneksi</span><span style="color: #007700;">) {</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>echo&nbsp;</span><span style="color: #dd0000;">'Gagal&nbsp;koneksi&nbsp;jhon,&nbsp;coba&nbsp;diliat&nbsp;file&nbsp;koneksinya'</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">mysql_error</span><span style="color: #007700;">(); }</span><span style="color: #0000bb;">mysql_select_db</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$db</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'nama_datbase'</span><span style="color: #007700;">])</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>or&nbsp;die&nbsp;(</span><span style="color: #dd0000;">"Database&nbsp;gak&nbsp;ada&nbsp;jhon,&nbsp;coba&nbsp;di&nbsp;cek&nbsp;dah"</span><span style="color: #007700;">.</span><span style="color: #0000bb;">mysql_error</span><span style="color: #007700;">());</span><span style="color: #0000bb;">?&gt;</span></span></code></pre> simpan file di atas dengan nama konek.php<br />nah kalo udah sekarang kita bikin file TampilMahasiswa.php<br /><div class="codeheader"> Kode: <a class="codeoperation" href="//www.blogger.com/blogger.g?blogID=3945660030349696922">[Pilih]</a></div> <pre style="margin: 0; padding: 0;"><code class="bbc_code" style="overflow: scroll;"><span style="color: black;"><span style="color: #0000bb;">&lt;?php</span><span style="color: #007700;">include_once&nbsp;</span><span style="color: #dd0000;">"konek.php"</span><span style="color: #007700;">;</span><span style="color: #0000bb;">?&gt;</span></span> &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Data Mahasiswa&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;table width="100%" align="center" border="1px"&gt; &lt;tr&gt; &lt;td colspan="6"&gt;&lt;strong&gt;&lt;font size="+3"&gt;&lt;p align="center"&gt; DATA MAHASISWA &lt;/p&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;NIM&lt;/td&gt; &lt;td&gt;NAMA&lt;/td&gt; &lt;td&gt;TANGGAL LAHIR&lt;/td&gt; &lt;td&gt;ALAMAT&lt;/td&gt; &lt;TD&gt;EMAIL&lt;/TD&gt; &lt;TD&gt;AKSI&lt;/TD&gt; &lt;/tr&gt; <span style="color: black;"><span style="color: #0000bb;">&lt;?php $sql&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #dd0000;">"select&nbsp;*&nbsp;from&nbsp;mahasiswa&nbsp;order&nbsp;by&nbsp;nim"</span><span style="color: #007700;">;</span><span style="color: #0000bb;">$qry&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #0000bb;">mysql_query</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$sql</span><span style="color: #007700;">,</span><span style="color: #0000bb;">$koneksi</span><span style="color: #007700;">)&nbsp;or&nbsp;die&nbsp;(</span><span style="color: #dd0000;">"Query&nbsp;gagal"</span><span style="color: #007700;">); while&nbsp;(</span><span style="color: #0000bb;">$mahasiswa&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #0000bb;">mysql_fetch_array</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$qry</span><span style="color: #007700;">)) {</span><span style="color: #0000bb;">?&gt;</span></span> &lt;tr&gt; &lt;td&gt;<span style="color: black;"><span style="color: #0000bb;">&lt;?php&nbsp;</span><span style="color: #007700;">echo&nbsp;</span><span style="color: #0000bb;">$mahasiswa</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'nim'</span><span style="color: #007700;">];&nbsp;</span><span style="color: #0000bb;">?&gt;</span></span>&lt;/td&gt; &lt;td&gt;<span style="color: black;"><span style="color: #0000bb;">&lt;?php&nbsp;</span><span style="color: #007700;">echo&nbsp;</span><span style="color: #0000bb;">$mahasiswa</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'nama'</span><span style="color: #007700;">];&nbsp;</span><span style="color: #0000bb;">?&gt;</span></span>&lt;/td&gt; &lt;td&gt;<span style="color: black;"><span style="color: #0000bb;">&lt;?php&nbsp;</span><span style="color: #007700;">echo&nbsp;</span><span style="color: #0000bb;">$mahasiswa</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'tgl_lahir'</span><span style="color: #007700;">];&nbsp;</span><span style="color: #0000bb;">?&gt;</span></span>&lt;/td&gt; &lt;td&gt;<span style="color: black;"><span style="color: #0000bb;">&lt;?php&nbsp;</span><span style="color: #007700;">echo&nbsp;</span><span style="color: #0000bb;">$mahasiswa</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'alamat'</span><span style="color: #007700;">];&nbsp;</span><span style="color: #0000bb;">?&gt;</span></span>&lt;/td&gt; &lt;td&gt;<span style="color: black;"><span style="color: #0000bb;">&lt;?php&nbsp;</span><span style="color: #007700;">echo&nbsp;</span><span style="color: #0000bb;">$mahasiswa</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'email'</span><span style="color: #007700;">];&nbsp;</span><span style="color: #0000bb;">?&gt;</span></span>&lt;/td&gt; &lt;td&gt;&lt;a href="EditMahasiswa.php?kodeEdit=<span style="color: black;"><span style="color: #0000bb;">&lt;?php&nbsp;</span><span style="color: #007700;">echo&nbsp;</span><span style="color: #0000bb;">$mahasiswa</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'nim'</span><span style="color: #007700;">];&nbsp;</span><span style="color: #0000bb;">?&gt;</span></span>"&gt;Edit&lt;/a&gt; | &lt;a href="HapusMahasiswa.php?kodeHapus=<span style="color: black;"><span style="color: #0000bb;">&lt;?php&nbsp;</span><span style="color: #007700;">echo&nbsp;</span><span style="color: #0000bb;">$mahasiswa</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'nim'</span><span style="color: #007700;">];&nbsp;</span><span style="color: #0000bb;">?&gt;</span></span>"&gt;Hapus&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; <span style="color: black;"><span style="color: #0000bb;">&lt;?php</span><span style="color: #007700;">}</span><span style="color: #0000bb;">?&gt;</span></span> &lt;/table&gt; &lt;a href="http://localhost/thread/"&gt;View List File&lt;/a&gt; &lt;/body&gt; &lt;/html&gt;</code></pre> Simpan file di atas dengan nama TampilMahasiswa.php<br />lanjut kita bikin file tambahmahasiswa buat isi data mahasiswa yang mau dimasukin ke database<br /><div class="codeheader"> Kode: <a class="codeoperation" href="//www.blogger.com/blogger.g?blogID=3945660030349696922">[Pilih]</a></div> <pre style="margin: 0; padding: 0;"><code class="bbc_code">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Tambah Mahasiswa&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form method="post" name="FormSimpanMahasiswa" action="SimpanMahasiswa.php"&gt; &lt;table width="700px" border="0px" align="center"&gt; &lt;tr&gt; &lt;td colspan="3"&gt;&lt;strong&gt;&lt;p align="center"&gt;Masukkan Data Mahasiswa&lt;/p&gt;&lt;/strong&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="20%"&gt;NIM&lt;/td&gt; &lt;td width="5%"&gt; : &lt;/td&gt; &lt;td width="75%"&gt;&lt;input type="text" name="TxtNim" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="20%"&gt;Nama&lt;/td&gt; &lt;td width="5%"&gt; : &lt;/td&gt; &lt;td width="75%"&gt;&lt;input type="text" name="TxtNama" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="20%"&gt;Tanggal Lahir&lt;/td&gt; &lt;td width="5%"&gt; : &lt;/td&gt; &lt;td width="75%"&gt;&lt;input type="text" name="TxtTglLahir" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="20%"&gt;Alamat&lt;/td&gt; &lt;td width="5%"&gt; : &lt;/td&gt; &lt;td width="75%"&gt;&lt;textarea name="TxtAlamat"&gt;&lt;/textarea&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="20%"&gt;Email&lt;/td&gt; &lt;td width="5%"&gt; : &lt;/td&gt; &lt;td width="75%"&gt;&lt;input type="text" name="TxtEmail" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="3"&gt;&lt;input type="submit" name="SimpanMahasiswa" value="Simpen" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt;</code></pre> simpan file di atas dengan nama TambahMahasiswa.php<br />kalo udah sekarang kita bikin file simpanmahasiswa.php buat nyimpen data yang udah diisiin di file&nbsp; tambah mahasiswa ke database<br /><div class="codeheader"> Kode: <a class="codeoperation" href="//www.blogger.com/blogger.g?blogID=3945660030349696922">[Pilih]</a></div> <pre style="margin: 0; padding: 0;"><code class="bbc_code"><span style="color: black;"><span style="color: #0000bb;">&lt;?php</span><span style="color: #007700;">if&nbsp;(</span><span style="color: #0000bb;">$_POST</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'SimpanMahasiswa'</span><span style="color: #007700;">]) {</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$TxtNim&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #0000bb;">$_POST</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'TxtNim'</span><span style="color: #007700;">];</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$TxtNama&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #0000bb;">$_POST</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'TxtNama'</span><span style="color: #007700;">];</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$TxtTglLahir&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #0000bb;">$_POST</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'TxtTglLahir'</span><span style="color: #007700;">];</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$TxtAlamat&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #0000bb;">$_POST</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'TxtAlamat'</span><span style="color: #007700;">];</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$TxtEmail&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #0000bb;">$_POST</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'TxtEmail'</span><span style="color: #007700;">];</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>if&nbsp;(</span><span style="color: #0000bb;">trim&nbsp;</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$TxtNim&nbsp;</span><span style="color: #007700;">==&nbsp;</span><span style="color: #dd0000;">''</span><span style="color: #007700;">))</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>{</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$pesan</span><span style="color: #007700;">[]&nbsp;=&nbsp;</span><span style="color: #dd0000;">'Data&nbsp;NIM&nbsp;mahasiswa&nbsp;belum&nbsp;diisi&nbsp;'</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>}</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>if&nbsp;(</span><span style="color: #0000bb;">trim&nbsp;</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$TxtNama&nbsp;</span><span style="color: #007700;">==&nbsp;</span><span style="color: #dd0000;">''</span><span style="color: #007700;">))</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>{</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$pesan</span><span style="color: #007700;">[]&nbsp;=&nbsp;</span><span style="color: #dd0000;">'Data&nbsp;nama&nbsp;mahasiswa&nbsp;belum&nbsp;diisi&nbsp;'</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>}</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>if&nbsp;(</span><span style="color: #0000bb;">trim&nbsp;</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$TxtTglLahir&nbsp;</span><span style="color: #007700;">==&nbsp;</span><span style="color: #dd0000;">''</span><span style="color: #007700;">))</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>{</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$pesan</span><span style="color: #007700;">[]&nbsp;=&nbsp;</span><span style="color: #dd0000;">'Data&nbsp;tanggal&nbsp;lahir&nbsp;belum&nbsp;diisi'</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>}</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>if&nbsp;(</span><span style="color: #0000bb;">trim</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$TxtAlamat</span><span style="color: #007700;">==</span><span style="color: #dd0000;">''</span><span style="color: #007700;">))</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>{</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$pesan</span><span style="color: #007700;">[]&nbsp;=&nbsp;</span><span style="color: #dd0000;">'Data&nbsp;alamat&nbsp;belum&nbsp;diisi'</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>}</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>if&nbsp;(</span><span style="color: #0000bb;">trim&nbsp;</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$TxtEmail</span><span style="color: #007700;">==</span><span style="color: #dd0000;">''</span><span style="color: #007700;">))</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>{</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$pesan</span><span style="color: #007700;">[]&nbsp;=&nbsp;</span><span style="color: #dd0000;">'data&nbsp;email&nbsp;belum&nbsp;diisi'</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>}</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>if&nbsp;(!&nbsp;</span><span style="color: #0000bb;">count&nbsp;</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$pesan</span><span style="color: #007700;">)==</span><span style="color: #0000bb;">0</span><span style="color: #007700;">)</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>{</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$urutin_pesan&nbsp;</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>include_once&nbsp;</span><span style="color: #dd0000;">'TambahMahasiswa.php'</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>foreach&nbsp;(</span><span style="color: #0000bb;">$pesan&nbsp;</span><span style="color: #007700;">as&nbsp;</span><span style="color: #0000bb;">$indeks&nbsp;</span><span style="color: #007700;">=&gt;&nbsp;</span><span style="color: #0000bb;">$pesan_error</span><span style="color: #007700;">)</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>{</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$urutin_pesan</span><span style="color: #007700;">+=</span><span style="color: #0000bb;">1</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>echo&nbsp;</span><span style="color: #dd0000;">"&nbsp;&lt;font&nbsp;color='red'&gt;</span><span style="color: #0000bb;">$urutin_pesan</span><span style="color: #dd0000;">.</span><span style="color: #0000bb;">$pesan_error</span><span style="color: #dd0000;">&lt;br&nbsp;/&gt;&lt;/font&gt;"</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>}</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>exit;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>}</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>else</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>{</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>include_once&nbsp;</span><span style="color: #dd0000;">'konek.php'</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$query&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #dd0000;">"insert&nbsp;into&nbsp;mahasiswa&nbsp;values&nbsp;('</span><span style="color: #0000bb;">$TxtNim</span><span style="color: #dd0000;">','</span><span style="color: #0000bb;">$TxtNama</span><span style="color: #dd0000;">','</span><span style="color: #0000bb;">$TxtTglLahir</span><span style="color: #dd0000;">','</span><span style="color: #0000bb;">$TxtAlamat</span><span style="color: #dd0000;">','</span><span style="color: #0000bb;">$TxtEmail</span><span style="color: #dd0000;">')"</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">mysql_query&nbsp;</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$query</span><span style="color: #007700;">,</span><span style="color: #0000bb;">$koneksi</span><span style="color: #007700;">)&nbsp;or&nbsp;die&nbsp;(</span><span style="color: #dd0000;">'gagal&nbsp;simpen&nbsp;data'</span><span style="color: #007700;">.</span><span style="color: #0000bb;">mysql_error</span><span style="color: #007700;">());</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>echo&nbsp;</span><span style="color: #dd0000;">"Proses&nbsp;simpan&nbsp;berhasil"</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>include_once&nbsp;</span><span style="color: #dd0000;">'TampilMahasiswa.php'</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>} } else {</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>include&nbsp;</span><span style="color: #dd0000;">'TambahMahasiswa.php'</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>exit; }</span><span style="color: #0000bb;">?&gt;</span></span></code></pre> simpan file di atas dengan nama SimpanMahasiswa.php<span style="margin: 0 -0.5ex 0 0;"> </span>. oke lanjut bikin file edit mahasiswa<br /><div class="codeheader"> Kode: <a class="codeoperation" href="//www.blogger.com/blogger.g?blogID=3945660030349696922">[Pilih]</a></div> <pre style="margin: 0; padding: 0;"><code class="bbc_code"><span style="color: black;"><span style="color: #0000bb;">&lt;?php</span><span style="color: #007700;">if&nbsp;(!&nbsp;</span><span style="color: #0000bb;">$_GET</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'kodeEdit'</span><span style="color: #007700;">]==</span><span style="color: #dd0000;">""</span><span style="color: #007700;">) {</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>include_once&nbsp;</span><span style="color: #dd0000;">"konek.php"</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$sql&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #dd0000;">"select&nbsp;*&nbsp;from&nbsp;mahasiswa&nbsp;where&nbsp;nim&nbsp;=&nbsp;'"</span><span style="color: #007700;">.</span><span style="color: #0000bb;">$_GET</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'kodeEdit'</span><span style="color: #007700;">].</span><span style="color: #dd0000;">"'"</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$qry&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #0000bb;">mysql_query</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$sql</span><span style="color: #007700;">,</span><span style="color: #0000bb;">$koneksi</span><span style="color: #007700;">)&nbsp;or&nbsp;die&nbsp;(</span><span style="color: #dd0000;">"gagal&nbsp;ngejalanin&nbsp;sql"</span><span style="color: #007700;">);</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$mahasiswa&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #0000bb;">mysql_fetch_array&nbsp;</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$qry</span><span style="color: #007700;">);</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$TxtNim&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #0000bb;">$mahasiswa</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'nim'</span><span style="color: #007700;">];</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$TxtNama&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #0000bb;">$mahasiswa</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'nama'</span><span style="color: #007700;">];</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$TxtTglLahir&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #0000bb;">$mahasiswa</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'tgl_lahir'</span><span style="color: #007700;">];</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$TxtAlamat&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #0000bb;">$mahasiswa</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'alamat'</span><span style="color: #007700;">];</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$TxtEmail&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #0000bb;">$mahasiswa</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'email'</span><span style="color: #007700;">]; </span><span style="color: #0000bb;">?&gt;</span></span> &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Tambah Mahasiswa&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form method="post" name="SimpanUbahMahasiswa" action="SimpanEditMahasiswa.php"&gt; &lt;table width="700px" border="0px" align="center"&gt; &lt;tr&gt; &lt;td colspan="3"&gt;&lt;strong&gt;&lt;p align="center"&gt;Edit Data Mahasiswa&lt;/p&gt;&lt;/strong&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="20%"&gt;NIM&lt;/td&gt; &lt;td width="5%"&gt; : &lt;/td&gt; &lt;td width="75%"&gt;&lt;input type="text" name="TxtNim" value="<span style="color: black;"><span style="color: #0000bb;">&lt;?php&nbsp;</span><span style="color: #007700;">echo&nbsp;</span><span style="color: #0000bb;">$TxtNim</span><span style="color: #007700;">;&nbsp;</span><span style="color: #0000bb;">?&gt;</span></span>" readonly="readonly" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="20%"&gt;Nama&lt;/td&gt; &lt;td width="5%"&gt; : &lt;/td&gt; &lt;td width="75%"&gt;&lt;input type="text" name="TxtNama" value="<span style="color: black;"><span style="color: #0000bb;">&lt;?php&nbsp;</span><span style="color: #007700;">echo&nbsp;</span><span style="color: #0000bb;">$TxtNama</span><span style="color: #007700;">;&nbsp;</span><span style="color: #0000bb;">?&gt;</span></span>" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="20%"&gt;Tanggal Lahir&lt;/td&gt; &lt;td width="5%"&gt; : &lt;/td&gt; &lt;td width="75%"&gt;&lt;input type="text" name="TxtTglLahir" value="<span style="color: black;"><span style="color: #0000bb;">&lt;?php&nbsp;</span><span style="color: #007700;">echo&nbsp;</span><span style="color: #0000bb;">$TxtTglLahir</span><span style="color: #007700;">;&nbsp;</span><span style="color: #0000bb;">?&gt;</span></span>" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="20%"&gt;Alamat&lt;/td&gt; &lt;td width="5%"&gt; : &lt;/td&gt; &lt;td width="75%"&gt;&lt;textarea name="TxtAlamat"&gt; <span style="color: black;"><span style="color: #0000bb;">&lt;?php&nbsp;</span><span style="color: #007700;">echo&nbsp;</span><span style="color: #0000bb;">$TxtAlamat</span><span style="color: #007700;">;&nbsp;</span><span style="color: #0000bb;">?&gt;</span></span>&lt;/textarea&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="20%"&gt;Email&lt;/td&gt; &lt;td width="5%"&gt; : &lt;/td&gt; &lt;td width="75%"&gt;&lt;input type="text" name="TxtEmail" value="<span style="color: black;"><span style="color: #0000bb;">&lt;?php&nbsp;</span><span style="color: #007700;">echo&nbsp;</span><span style="color: #0000bb;">$TxtEmail</span><span style="color: #007700;">;&nbsp;</span><span style="color: #0000bb;">?&gt;</span></span>" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="6"&gt;&lt;input type="submit" name="SimpanEditMahasiswa" value="Simpen" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; <span style="color: black;"><span style="color: #0000bb;">&lt;?php</span><span style="color: #007700;">} else {</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>include_once&nbsp;</span><span style="color: #dd0000;">"TampilMahasiswa.php"</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>exit; }</span></span></code></pre> simpan file diatas dengan nama EditMahsiswa.php<br /><br />file simpan edit mahasiswa<br /><div class="codeheader"> Kode: <a class="codeoperation" href="//www.blogger.com/blogger.g?blogID=3945660030349696922">[Pilih]</a></div> <pre style="margin: 0; padding: 0;"><code class="bbc_code" style="overflow: scroll;"><span style="color: black;"><span style="color: #0000bb;">&lt;?php</span><span style="color: #007700;">if&nbsp;(</span><span style="color: #0000bb;">$_POST</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'SimpanEditMahasiswa'</span><span style="color: #007700;">]) {</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$TxtNim&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #0000bb;">$_POST</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'TxtNim'</span><span style="color: #007700;">];</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$TxtNama&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #0000bb;">$_POST</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'TxtNama'</span><span style="color: #007700;">];</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$TxtTglLahir&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #0000bb;">$_POST</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'TxtTglLahir'</span><span style="color: #007700;">];</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$TxtAlamat&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #0000bb;">$_POST</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'TxtAlamat'</span><span style="color: #007700;">];</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$TxtEmail&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #0000bb;">$_POST</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'TxtEmail'</span><span style="color: #007700;">];</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>if&nbsp;(</span><span style="color: #0000bb;">trim&nbsp;</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$TxtNim&nbsp;</span><span style="color: #007700;">==&nbsp;</span><span style="color: #dd0000;">''</span><span style="color: #007700;">))</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>{</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$pesan</span><span style="color: #007700;">[]&nbsp;=&nbsp;</span><span style="color: #dd0000;">'Data&nbsp;NIM&nbsp;mahasiswa&nbsp;belum&nbsp;diisi&nbsp;'</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>}</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>if&nbsp;(</span><span style="color: #0000bb;">trim&nbsp;</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$TxtNama&nbsp;</span><span style="color: #007700;">==&nbsp;</span><span style="color: #dd0000;">''</span><span style="color: #007700;">))</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>{</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$pesan</span><span style="color: #007700;">[]&nbsp;=&nbsp;</span><span style="color: #dd0000;">'Data&nbsp;nama&nbsp;mahasiswa&nbsp;belum&nbsp;diisi&nbsp;'</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>}</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>if&nbsp;(</span><span style="color: #0000bb;">trim&nbsp;</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$TxtTglLahir&nbsp;</span><span style="color: #007700;">==&nbsp;</span><span style="color: #dd0000;">''</span><span style="color: #007700;">))</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>{</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$pesan</span><span style="color: #007700;">[]&nbsp;=&nbsp;</span><span style="color: #dd0000;">'Data&nbsp;tanggal&nbsp;lahir&nbsp;belum&nbsp;diisi'</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>}</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>if&nbsp;(</span><span style="color: #0000bb;">trim</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$TxtAlamat</span><span style="color: #007700;">==</span><span style="color: #dd0000;">''</span><span style="color: #007700;">))</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>{</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$pesan</span><span style="color: #007700;">[]&nbsp;=&nbsp;</span><span style="color: #dd0000;">'Data&nbsp;alamat&nbsp;belum&nbsp;diisi'</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>}</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>if&nbsp;(</span><span style="color: #0000bb;">trim&nbsp;</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$TxtEmail</span><span style="color: #007700;">==</span><span style="color: #dd0000;">''</span><span style="color: #007700;">))</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>{</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$pesan</span><span style="color: #007700;">[]&nbsp;=&nbsp;</span><span style="color: #dd0000;">'data&nbsp;email&nbsp;belum&nbsp;diisi'</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>}</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>if&nbsp;(!&nbsp;</span><span style="color: #0000bb;">count&nbsp;</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$pesan</span><span style="color: #007700;">)==</span><span style="color: #0000bb;">0</span><span style="color: #007700;">)</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>{</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$urutin_pesan&nbsp;</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>include_once&nbsp;</span><span style="color: #dd0000;">'EditMahasiswa.php'</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>foreach&nbsp;(</span><span style="color: #0000bb;">$pesan&nbsp;</span><span style="color: #007700;">as&nbsp;</span><span style="color: #0000bb;">$indeks&nbsp;</span><span style="color: #007700;">=&gt;&nbsp;</span><span style="color: #0000bb;">$pesan_error</span><span style="color: #007700;">)</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>{</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$urutin_pesan</span><span style="color: #007700;">+=</span><span style="color: #0000bb;">1</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>echo&nbsp;</span><span style="color: #dd0000;">"&nbsp;&lt;font&nbsp;color='red'&gt;</span><span style="color: #0000bb;">$urutin_pesan</span><span style="color: #dd0000;">.</span><span style="color: #0000bb;">$pesan_error</span><span style="color: #dd0000;">&lt;br&nbsp;/&gt;&lt;/font&gt;"</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>}</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>exit;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>}</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>else</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>{</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>include_once&nbsp;</span><span style="color: #dd0000;">'konek.php'</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$query&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #dd0000;">"update&nbsp;mahasiswa&nbsp;set&nbsp;nim='</span><span style="color: #0000bb;">$TxtNim</span><span style="color: #dd0000;">',nama='</span><span style="color: #0000bb;">$TxtNama</span><span style="color: #dd0000;">',tgl_lahir='</span><span style="color: #0000bb;">$TxtTglLahir</span><span style="color: #dd0000;">',alamat='</span><span style="color: #0000bb;">$TxtAlamat</span><span style="color: #dd0000;">',email='</span><span style="color: #0000bb;">$TxtEmail</span><span style="color: #dd0000;">'&nbsp;where&nbsp;nim='</span><span style="color: #0000bb;">$TxtNim</span><span style="color: #dd0000;">'"</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">mysql_query&nbsp;</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$query</span><span style="color: #007700;">,</span><span style="color: #0000bb;">$koneksi</span><span style="color: #007700;">)&nbsp;or&nbsp;die&nbsp;(</span><span style="color: #dd0000;">'gagal&nbsp;simpen&nbsp;data'</span><span style="color: #007700;">.</span><span style="color: #0000bb;">mysql_error</span><span style="color: #007700;">());</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>echo&nbsp;</span><span style="color: #dd0000;">"Proses&nbsp;update&nbsp;berhasil"</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>include_once&nbsp;</span><span style="color: #dd0000;">'TampilMahasiswa.php'</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>} } else {</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>include&nbsp;</span><span style="color: #dd0000;">'TampilMahasiswa.php'</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>exit; }</span><span style="color: #0000bb;">?&gt;</span></span></code></pre> <br />simpan file diatas dengan nama SimpanEditMahasiswa<span style="margin: 0 -0.5ex 0 0;"> </span>.php<br /><br />terakhir buat file hapus.php<br /><div class="codeheader"> Kode: <a class="codeoperation" href="//www.blogger.com/blogger.g?blogID=3945660030349696922">[Pilih]</a></div> <pre style="margin: 0; padding: 0;"><code class="bbc_code"><span style="color: black;"><span style="color: #0000bb;">&lt;?php</span><span style="color: #007700;">if(!&nbsp;</span><span style="color: #0000bb;">$_GET</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'kodeHapus'</span><span style="color: #007700;">]&nbsp;==&nbsp;</span><span style="color: #dd0000;">""</span><span style="color: #007700;">) {</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>include_once&nbsp;</span><span style="color: #dd0000;">"konek.php"</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$sql</span><span style="color: #007700;">=</span><span style="color: #dd0000;">"delete&nbsp;from&nbsp;mahasiswa&nbsp;where&nbsp;nim='"</span><span style="color: #007700;">.</span><span style="color: #0000bb;">$_GET</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'kodeHapus'</span><span style="color: #007700;">].</span><span style="color: #dd0000;">"'"</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span></span><span style="color: #0000bb;">$qry&nbsp;</span><span style="color: #007700;">=&nbsp;</span><span style="color: #0000bb;">mysql_query</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$sql</span><span style="color: #007700;">,</span><span style="color: #0000bb;">$koneksi</span><span style="color: #007700;">)&nbsp;or&nbsp;die&nbsp;(</span><span style="color: #dd0000;">"Gagal&nbsp;hapus&nbsp;jhon"</span><span style="color: #007700;">);</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>echo&nbsp;</span><span style="color: #dd0000;">"Data&nbsp;mahasiswa&nbsp;berhasil&nbsp;dihapus"</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>include&nbsp;</span><span style="color: #dd0000;">"TampilMahasiswa.php"</span><span style="color: #007700;">; } else {</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>include&nbsp;</span><span style="color: #dd0000;">"TampilMahasiswa.php"</span><span style="color: #007700;">;</span><span style="color: #0000bb;"><span style="white-space: pre;"> </span>exit; }</span><span style="color: #0000bb;">?&gt;</span></span></code></pre> simpan dengan nama hapus.php<br /><br />simpan semua file tersebut dalam satu folder coba deh akses dari browser <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'><span class='post-author vcard'> Diposting oleh <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'> <meta content='https://www.blogger.com/profile/15869231707966236211' itemprop='url'/> <a href='https://www.blogger.com/profile/15869231707966236211' rel='author' title='author profile'> <span itemprop='name'>Unknown</span> </a> </span> </span> <span class='post-timestamp'> di <meta content='https://loebizpiss.blogspot.com/2012/11/manipulasi-data-mysql-dengan-php-select_9.html' itemprop='url'/> <a class='timestamp-link' href='https://loebizpiss.blogspot.com/2012/11/manipulasi-data-mysql-dengan-php-select_9.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2012-11-09T06:58:00-08:00'>06.58</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://loebizpiss.blogspot.com/2012/11/manipulasi-data-mysql-dengan-php-select_9.html#comment-form' onclick=''> Tidak ada komentar: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-80050670'> <a href='https://www.blogger.com/post-edit.g?blogID=3945660030349696922&postID=8818574323812054850&from=pencil' title='Edit Entri'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=3945660030349696922&postID=8818574323812054850&target=email' target='_blank' title='Kirimkan Ini lewat Email'><span class='share-button-link-text'>Kirimkan Ini lewat Email</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=3945660030349696922&postID=8818574323812054850&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=3945660030349696922&postID=8818574323812054850&target=twitter' target='_blank' title='Bagikan ke X'><span class='share-button-link-text'>Bagikan ke X</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=3945660030349696922&postID=8818574323812054850&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Berbagi ke Facebook'><span class='share-button-link-text'>Berbagi ke Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=3945660030349696922&postID=8818574323812054850&target=pinterest' target='_blank' title='Bagikan ke Pinterest'><span class='share-button-link-text'>Bagikan ke Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'><span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'><span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='3945660030349696922' itemprop='blogId'/> <meta content='212647234727762683' itemprop='postId'/> <a name='212647234727762683'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://loebizpiss.blogspot.com/2012/11/aplikasi-sederhana-php-mysql-select.html'>Aplikasi Sederhana PHP-MySQL (Select, Insert, Update, Delete, Searching, Paging) menggunakan Konsep OOP</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-212647234727762683' itemprop='description articleBody'> <div class="post-img"> <div class="post-img-box"> <a href="http://www.citstudio.com/articles/aplikasi-sederhana-php-mysql-select-insert-update-delete-searching-paging-menggunakan-konsep-oop/"><img alt="" src="https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_uT8_RxxCovrlQ2jmbIFqx6H3VxBS9dIlp-ujt9ebHiU51j7Zh9tP3Fg7nvOPmHSf23VhJS3HHQ1nv-bp-ZgaS7hUlLu17JCD2PfKcn8SOGA4YPJmwTsF3wI1QQM0HzS4kAdSOA=s0-d"></a> </div> </div> <h2> <a href="http://www.citstudio.com/articles/aplikasi-sederhana-php-mysql-select-insert-update-delete-searching-paging-menggunakan-konsep-oop/" title="Permanent Link to Aplikasi Sederhana PHP-MySQL (Select, Insert, Update, Delete, Searching, Paging) menggunakan Konsep OOP">Aplikasi Sederhana PHP-MySQL (Select, Insert, Update, Delete, Searching, Paging) menggunakan Konsep OOP</a></h2> Bagi Programmer yang baru menginjakan di Dunia PHP, atau bahasa pemrograman lainnya, hal yang pertama dicari adalah mengetahui sifat-sifat dari bahasa pemrograman tersebut. Kemudian, bagaimana cara nya mengakses Database, menampilkan data, menyimpan data, merubah data, menghapus data, melakukan pencarian, dan membuat paging.<span id="more-1640"></span><br /> Kali ini kita akan coba membuat aplikasi sederhana menggunakan PHP-MySQL dengan kasus seperti diatas. Kurang lebih memiliki tampilan seperti dibawah :<br /> <div style="text-align: center;"> <a href="http://www.citstudio.com/wp-content/uploads/2012/07/a.png"><img alt="Aplikasi PHP MySQL" class="aligncenter size-medium wp-image-1641" height="158" src="https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_saBEpOplgXSKXnLnfsyEqsU4BrDtBmSVu_6oqZhXnoYm2VU4BFSvuKAiYRgP-C72PaDkNnCdcz1DNm9-PXh_xUMWjF8Gfgp3eTm6FvC8xcnEfxEvhpYhMRkZbB19vdjvETgxg=s0-d" style="border: 1px solid black;" title="a" width="300"></a></div> Sebelumnya, kita lihat <a href="http://www.citstudio.com/articles/php-mysql-membuat-class-database/" target="_blank">artikel ini</a>&nbsp;, karena kita akan menggunakan konsep OOP dalam melakukan akses database. untuk <a href="http://www.citstudio.com/wp-content/uploads/2012/07/paging.zip" target="_blank">script lengkap bisa dilihat disini</a> :<br /> <div> <div class="syntaxhighlighter php" id="highlighter_366495"> <div class="toolbar"> <a class="toolbar_item command_help help" href="http://www.citstudio.com/articles/aplikasi-sederhana-php-mysql-select-insert-update-delete-searching-paging-menggunakan-konsep-oop/#">?</a></div> <table border="0" cellpadding="0" cellspacing="0"><tbody> <tr><td class="gutter"><div class="line number1 index0 alt2"> 1</div> <div class="line number2 index1 alt1"> 2</div> <div class="line number3 index2 alt2"> 3</div> <div class="line number4 index3 alt1"> 4</div> <div class="line number5 index4 alt2"> 5</div> <div class="line number6 index5 alt1"> 6</div> <div class="line number7 index6 alt2"> 7</div> <div class="line number8 index7 alt1"> 8</div> <div class="line number9 index8 alt2"> 9</div> <div class="line number10 index9 alt1"> 10</div> <div class="line number11 index10 alt2"> 11</div> <div class="line number12 index11 alt1"> 12</div> <div class="line number13 index12 alt2"> 13</div> <div class="line number14 index13 alt1"> 14</div> <div class="line number15 index14 alt2"> 15</div> <div class="line number16 index15 alt1"> 16</div> <div class="line number17 index16 alt2"> 17</div> <div class="line number18 index17 alt1"> 18</div> <div class="line number19 index18 alt2"> 19</div> <div class="line number20 index19 alt1"> 20</div> <div class="line number21 index20 alt2"> 21</div> <div class="line number22 index21 alt1"> 22</div> <div class="line number23 index22 alt2"> 23</div> <div class="line number24 index23 alt1"> 24</div> <div class="line number25 index24 alt2"> 25</div> <div class="line number26 index25 alt1"> 26</div> <div class="line number27 index26 alt2"> 27</div> <div class="line number28 index27 alt1"> 28</div> <div class="line number29 index28 alt2"> 29</div> <div class="line number30 index29 alt1"> 30</div> <div class="line number31 index30 alt2"> 31</div> <div class="line number32 index31 alt1"> 32</div> <div class="line number33 index32 alt2"> 33</div> <div class="line number34 index33 alt1"> 34</div> <div class="line number35 index34 alt2"> 35</div> <div class="line number36 index35 alt1"> 36</div> <div class="line number37 index36 alt2"> 37</div> <div class="line number38 index37 alt1"> 38</div> <div class="line number39 index38 alt2"> 39</div> <div class="line number40 index39 alt1"> 40</div> <div class="line number41 index40 alt2"> 41</div> <div class="line number42 index41 alt1"> 42</div> <div class="line number43 index42 alt2"> 43</div> <div class="line number44 index43 alt1"> 44</div> <div class="line number45 index44 alt2"> 45</div> <div class="line number46 index45 alt1"> 46</div> <div class="line number47 index46 alt2"> 47</div> <div class="line number48 index47 alt1"> 48</div> <div class="line number49 index48 alt2"> 49</div> <div class="line number50 index49 alt1"> 50</div> <div class="line number51 index50 alt2"> 51</div> <div class="line number52 index51 alt1"> 52</div> <div class="line number53 index52 alt2"> 53</div> <div class="line number54 index53 alt1"> 54</div> <div class="line number55 index54 alt2"> 55</div> <div class="line number56 index55 alt1"> 56</div> <div class="line number57 index56 alt2"> 57</div> <div class="line number58 index57 alt1"> 58</div> <div class="line number59 index58 alt2"> 59</div> <div class="line number60 index59 alt1"> 60</div> <div class="line number61 index60 alt2"> 61</div> <div class="line number62 index61 alt1"> 62</div> <div class="line number63 index62 alt2"> 63</div> <div class="line number64 index63 alt1"> 64</div> <div class="line number65 index64 alt2"> 65</div> <div class="line number66 index65 alt1"> 66</div> <div class="line number67 index66 alt2"> 67</div> <div class="line number68 index67 alt1"> 68</div> <div class="line number69 index68 alt2"> 69</div> <div class="line number70 index69 alt1"> 70</div> <div class="line number71 index70 alt2"> 71</div> <div class="line number72 index71 alt1"> 72</div> <div class="line number73 index72 alt2"> 73</div> <div class="line number74 index73 alt1"> 74</div> <div class="line number75 index74 alt2"> 75</div> <div class="line number76 index75 alt1"> 76</div> <div class="line number77 index76 alt2"> 77</div> <div class="line number78 index77 alt1"> 78</div> <div class="line number79 index78 alt2"> 79</div> <div class="line number80 index79 alt1"> 80</div> <div class="line number81 index80 alt2"> 81</div> <div class="line number82 index81 alt1"> 82</div> <div class="line number83 index82 alt2"> 83</div> <div class="line number84 index83 alt1"> 84</div> <div class="line number85 index84 alt2"> 85</div> <div class="line number86 index85 alt1"> 86</div> <div class="line number87 index86 alt2"> 87</div> <div class="line number88 index87 alt1"> 88</div> <div class="line number89 index88 alt2"> 89</div> <div class="line number90 index89 alt1"> 90</div> <div class="line number91 index90 alt2"> 91</div> <div class="line number92 index91 alt1"> 92</div> <div class="line number93 index92 alt2"> 93</div> <div class="line number94 index93 alt1"> 94</div> <div class="line number95 index94 alt2"> 95</div> <div class="line number96 index95 alt1"> 96</div> <div class="line number97 index96 alt2"> 97</div> <div class="line number98 index97 alt1"> 98</div> <div class="line number99 index98 alt2"> 99</div> <div class="line number100 index99 alt1"> 100</div> <div class="line number101 index100 alt2"> 101</div> <div class="line number102 index101 alt1"> 102</div> <div class="line number103 index102 alt2"> 103</div> <div class="line number104 index103 alt1"> 104</div> <div class="line number105 index104 alt2"> 105</div> <div class="line number106 index105 alt1"> 106</div> <div class="line number107 index106 alt2"> 107</div> <div class="line number108 index107 alt1"> 108</div> <div class="line number109 index108 alt2"> 109</div> <div class="line number110 index109 alt1"> 110</div> <div class="line number111 index110 alt2"> 111</div> <div class="line number112 index111 alt1"> 112</div> <div class="line number113 index112 alt2"> 113</div> <div class="line number114 index113 alt1"> 114</div> <div class="line number115 index114 alt2"> 115</div> <div class="line number116 index115 alt1"> 116</div> <div class="line number117 index116 alt2"> 117</div> <div class="line number118 index117 alt1"> 118</div> <div class="line number119 index118 alt2"> 119</div> <div class="line number120 index119 alt1"> 120</div> <div class="line number121 index120 alt2"> 121</div> <div class="line number122 index121 alt1"> 122</div> <div class="line number123 index122 alt2"> 123</div> <div class="line number124 index123 alt1"> 124</div> <div class="line number125 index124 alt2"> 125</div> <div class="line number126 index125 alt1"> 126</div> <div class="line number127 index126 alt2"> 127</div> <div class="line number128 index127 alt1"> 128</div> <div class="line number129 index128 alt2"> 129</div> <div class="line number130 index129 alt1"> 130</div> <div class="line number131 index130 alt2"> 131</div> <div class="line number132 index131 alt1"> 132</div> <div class="line number133 index132 alt2"> 133</div> <div class="line number134 index133 alt1"> 134</div> <div class="line number135 index134 alt2"> 135</div> <div class="line number136 index135 alt1"> 136</div> <div class="line number137 index136 alt2"> 137</div> <div class="line number138 index137 alt1"> 138</div> <div class="line number139 index138 alt2"> 139</div> <div class="line number140 index139 alt1"> 140</div> <div class="line number141 index140 alt2"> 141</div> <div class="line number142 index141 alt1"> 142</div> <div class="line number143 index142 alt2"> 143</div> <div class="line number144 index143 alt1"> 144</div> <div class="line number145 index144 alt2"> 145</div> <div class="line number146 index145 alt1"> 146</div> <div class="line number147 index146 alt2"> 147</div> <div class="line number148 index147 alt1"> 148</div> <div class="line number149 index148 alt2"> 149</div> <div class="line number150 index149 alt1"> 150</div> <div class="line number151 index150 alt2"> 151</div> <div class="line number152 index151 alt1"> 152</div> <div class="line number153 index152 alt2"> 153</div> </td><td class="code"><div class="container"> <div class="line number1 index0 alt2"> <code class="php plain">&lt;?php</code></div> <div class="line number2 index1 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$filename</code> <code class="php plain">= </code><code class="php string">'database.class.php'</code><code class="php plain">;</code></div> <div class="line number3 index2 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">if</code> <code class="php plain">(!</code><code class="php functions">file_exists</code><code class="php plain">(</code><code class="php variable">$filename</code><code class="php plain">)){</code></div> <div class="line number4 index3 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php functions">echo</code> <code class="php string">"File Konfigurasi tidak ditemukan"</code><code class="php plain">;</code></div> <div class="line number5 index4 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">die</code><code class="php plain">();</code></div> <div class="line number6 index5 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">}</code></div> <div class="line number7 index6 alt2"> </div> <div class="line number8 index7 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">include</code> <code class="php variable">$filename</code><code class="php plain">;</code></div> <div class="line number9 index8 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$cn</code> <code class="php plain">= </code><code class="php keyword">new</code> <code class="php plain">mySql();</code></div> <div class="line number10 index9 alt1"> </div> <div class="line number11 index10 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">if</code><code class="php plain">(!</code><code class="php variable">$cn</code><code class="php plain">-&gt;openKoneksi()){</code></div> <div class="line number12 index11 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php functions">echo</code> <code class="php string">"Tidak Bisa Konek"</code><code class="php plain">;</code></div> <div class="line number13 index12 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">die</code><code class="php plain">();</code></div> <div class="line number14 index13 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">}</code></div> <div class="line number15 index14 alt2"> </div> <div class="line number16 index15 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">if</code> <code class="php plain">(!isset(</code><code class="php variable">$_REQUEST</code><code class="php plain">[</code><code class="php string">"mode"</code><code class="php plain">])){</code></div> <div class="line number17 index16 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$action</code> <code class="php plain">= </code><code class="php string">"simpan"</code><code class="php plain">;</code></div> <div class="line number18 index17 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">}</code><code class="php keyword">else</code><code class="php plain">{</code></div> <div class="line number19 index18 alt2"> </div> <div class="line number20 index19 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$kodeBank</code> <code class="php plain">= </code><code class="php variable">$_POST</code><code class="php plain">[</code><code class="php string">"tID"</code><code class="php plain">];</code></div> <div class="line number21 index20 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$namaBank</code> <code class="php plain">= </code><code class="php variable">$_POST</code><code class="php plain">[</code><code class="php string">"tNama"</code><code class="php plain">];</code></div> <div class="line number22 index21 alt1"> </div> <div class="line number23 index22 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">switch</code> <code class="php plain">(</code><code class="php variable">$_REQUEST</code><code class="php plain">[</code><code class="php string">"mode"</code><code class="php plain">]) {</code></div> <div class="line number24 index23 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">case</code> <code class="php string">"simpan"</code><code class="php plain">:</code></div> <div class="line number25 index24 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$action</code> <code class="php plain">= </code><code class="php string">"simpan"</code><code class="php plain">;</code></div> <div class="line number26 index25 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$values</code> <code class="php plain">= </code><code class="php string">"'"</code><code class="php plain">.</code><code class="php variable">$kodeBank</code><code class="php plain">.</code><code class="php string">"','"</code><code class="php plain">.</code><code class="php variable">$namaBank</code><code class="php plain">.</code><code class="php string">"'"</code><code class="php plain">;</code></div> <div class="line number27 index26 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$field</code> <code class="php plain">= </code><code class="php string">"kodeBank,namaBank"</code><code class="php plain">;</code></div> <div class="line number28 index27 alt1"> </div> <div class="line number29 index28 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">if</code><code class="php plain">(</code><code class="php variable">$cn</code><code class="php plain">-&gt;insertRows(</code><code class="php string">'tRefBank'</code><code class="php plain">,</code><code class="php variable">$field</code><code class="php plain">,</code><code class="php variable">$values</code><code class="php plain">)){</code></div> <div class="line number30 index29 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php functions">echo</code> <code class="php string">"Data Tersimpan"</code><code class="php plain">;</code></div> <div class="line number31 index30 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">}</code></div> <div class="line number32 index31 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">break</code><code class="php plain">;</code></div> <div class="line number33 index32 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">case</code> <code class="php string">"edit"</code><code class="php plain">:</code></div> <div class="line number34 index33 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$action</code> <code class="php plain">=</code><code class="php string">"update"</code><code class="php plain">;</code></div> <div class="line number35 index34 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$sql</code> <code class="php plain">= </code><code class="php string">"SELECT * FROM tRefBank WHERE kodeBank='"</code><code class="php plain">.</code><code class="php variable">$_REQUEST</code><code class="php plain">[</code><code class="php string">"kodeBank"</code><code class="php plain">].</code><code class="php string">"'"</code><code class="php plain">;</code></div> <div class="line number36 index35 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$exec</code> <code class="php plain">= </code><code class="php variable">$cn</code><code class="php plain">-&gt;execute(</code><code class="php variable">$sql</code><code class="php plain">);</code></div> <div class="line number37 index36 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">while</code> <code class="php plain">(</code><code class="php variable">$row</code> <code class="php plain">= </code><code class="php variable">$cn</code><code class="php plain">-&gt;getArray()){</code></div> <div class="line number38 index37 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$kodeBank</code> <code class="php plain">= </code><code class="php variable">$row</code><code class="php plain">[0];</code></div> <div class="line number39 index38 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$namaBank</code> <code class="php plain">= </code><code class="php variable">$row</code><code class="php plain">[1];</code></div> <div class="line number40 index39 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">}</code></div> <div class="line number41 index40 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">break</code><code class="php plain">;</code></div> <div class="line number42 index41 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">case</code> <code class="php string">"update"</code><code class="php plain">:</code></div> <div class="line number43 index42 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php comments">/* script insert */</code></div> <div class="line number44 index43 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$action</code> <code class="php plain">= </code><code class="php string">"simpan"</code><code class="php plain">;</code></div> <div class="line number45 index44 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$where</code> <code class="php plain">= </code><code class="php string">"kodeBank='"</code><code class="php plain">.</code><code class="php variable">$kodeBank</code><code class="php plain">.</code><code class="php string">"'"</code><code class="php plain">;</code></div> <div class="line number46 index45 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$field</code> <code class="php plain">= </code><code class="php string">"namaBank='"</code><code class="php plain">.</code><code class="php variable">$namaBank</code><code class="php plain">.</code><code class="php string">"'"</code><code class="php plain">;</code></div> <div class="line number47 index46 alt2"> </div> <div class="line number48 index47 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">if</code><code class="php plain">(</code><code class="php variable">$cn</code><code class="php plain">-&gt;updateRows(</code><code class="php string">'tRefBank'</code><code class="php plain">,</code><code class="php variable">$field</code><code class="php plain">,</code><code class="php variable">$where</code><code class="php plain">)){</code></div> <div class="line number49 index48 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php functions">echo</code> <code class="php string">"Data Tersimpan"</code><code class="php plain">;</code></div> <div class="line number50 index49 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">}</code></div> <div class="line number51 index50 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$kodeBank</code> <code class="php plain">= </code><code class="php string">""</code><code class="php plain">;</code></div> <div class="line number52 index51 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$namaBank</code> <code class="php plain">= </code><code class="php string">""</code><code class="php plain">;</code></div> <div class="line number53 index52 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">break</code><code class="php plain">;</code></div> <div class="line number54 index53 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">case</code> <code class="php string">"hapus"</code><code class="php plain">:</code></div> <div class="line number55 index54 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$action</code> <code class="php plain">= </code><code class="php string">"simpan"</code><code class="php plain">;</code></div> <div class="line number56 index55 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$where</code> <code class="php plain">= </code><code class="php string">"kodeBank='"</code><code class="php plain">.</code><code class="php variable">$_REQUEST</code><code class="php plain">[</code><code class="php string">"kodeBank"</code><code class="php plain">].</code><code class="php string">"'"</code><code class="php plain">;</code></div> <div class="line number57 index56 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$cn</code><code class="php plain">-&gt;deleteRows(</code><code class="php string">'tRefBank'</code><code class="php plain">,</code><code class="php variable">$where</code><code class="php plain">);</code></div> <div class="line number58 index57 alt1"> </div> <div class="line number59 index58 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">break</code><code class="php plain">;</code></div> <div class="line number60 index59 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">}</code></div> <div class="line number61 index60 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">}</code></div> <div class="line number62 index61 alt1"> </div> <div class="line number63 index62 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php comments">/* script update */</code></div> <div class="line number64 index63 alt1"> </div> <div class="line number65 index64 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php comments">/* script delete */</code></div> <div class="line number66 index65 alt1"> </div> <div class="line number67 index66 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php comments">/* script search */</code></div> <div class="line number68 index67 alt1"> </div> <div class="line number69 index68 alt2"> <code class="php plain">?&gt;</code></div> <div class="line number70 index69 alt1"> <code class="php plain">&lt;a href=</code><code class="php string">"&lt;?php echo "</code><code class="php plain">http:</code><code class="php comments">//".$_SERVER['SERVER_NAME']."/_test-script/paging/";?&gt;"&gt;REFRESH/HOME&lt;/a&gt;</code></div> <div class="line number71 index70 alt2"> <code class="php plain">&lt;hr/&gt;</code></div> <div class="line number72 index71 alt1"> <code class="php plain">&lt;form method=</code><code class="php string">"POST"</code> <code class="php plain">action=</code><code class="php string">"&lt;?php echo $PHP_SELF;?&gt;?mode=&lt;?php echo $action;?&gt;"</code><code class="php plain">&gt;</code></div> <div class="line number73 index72 alt2"> <code class="php plain">&lt;table&gt;</code></div> <div class="line number74 index73 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;tr&gt;</code></div> <div class="line number75 index74 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;td&gt;ID Bank&lt;/td&gt;</code></div> <div class="line number76 index75 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;td&gt;:&lt;/td&gt;</code></div> <div class="line number77 index76 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;td&gt;&lt;input type=</code><code class="php string">"text"</code> <code class="php plain">name=</code><code class="php string">"tID"</code> <code class="php plain">id=</code><code class="php string">"tID"</code> <code class="php plain">value=</code><code class="php string">"&lt;?php echo $kodeBank;?&gt;"</code>&nbsp; <code class="php plain">/&gt;&lt;/td&gt;</code></div> <div class="line number78 index77 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;/tr&gt;</code></div> <div class="line number79 index78 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;tr&gt;</code></div> <div class="line number80 index79 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;td&gt;Nama Bank&lt;/td&gt;</code></div> <div class="line number81 index80 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;td&gt;:&lt;/td&gt;</code></div> <div class="line number82 index81 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;td&gt;&lt;input type=</code><code class="php string">"text"</code> <code class="php plain">name=</code><code class="php string">"tNama"</code> <code class="php plain">id=</code><code class="php string">"tNama"</code> <code class="php plain">value=</code><code class="php string">"&lt;?php echo $namaBank;?&gt;"</code> <code class="php plain">/&gt;&lt;/td&gt;</code></div> <div class="line number83 index82 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;/tr&gt;</code></div> <div class="line number84 index83 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;tr&gt;</code></div> <div class="line number85 index84 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;td&gt;&amp;nbsp;&lt;/td&gt;</code></div> <div class="line number86 index85 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;td&gt;&amp;nbsp;&lt;/td&gt;</code></div> <div class="line number87 index86 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;td&gt;&lt;input type=</code><code class="php string">"submit"</code> <code class="php plain">value=</code><code class="php string">"simpan"</code> <code class="php plain">/&gt;&lt;/td&gt;</code></div> <div class="line number88 index87 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;/tr&gt;</code></div> <div class="line number89 index88 alt2"> <code class="php plain">&lt;/table&gt;</code></div> <div class="line number90 index89 alt1"> <code class="php plain">&lt;/form&gt;</code></div> <div class="line number91 index90 alt2"> <code class="php plain">&lt;?php </code><code class="php comments">/*******************************************************************************/</code> <code class="php plain">?&gt;</code></div> <div class="line number92 index91 alt1"> <code class="php plain">&lt;?php</code></div> <div class="line number93 index92 alt2"> </div> <div class="line number94 index93 alt1"> <code class="php plain">?&gt;</code></div> <div class="line number95 index94 alt2"> <code class="php plain">&lt;table&gt;</code></div> <div class="line number96 index95 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;tr&gt;</code></div> <div class="line number97 index96 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;td&gt;</code></div> <div class="line number98 index97 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;form action=</code><code class="php string">"&lt;?php $PHP_SELF;?&gt;"</code> <code class="php plain">method=</code><code class="php string">"get"</code><code class="php plain">&gt;</code></div> <div class="line number99 index98 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;input type=</code><code class="php string">"text"</code> <code class="php plain">name=</code><code class="php string">"namaBank"</code><code class="php plain">/&gt;&lt;input type=</code><code class="php string">"submit"</code> <code class="php plain">value=</code><code class="php string">"cari !"</code><code class="php plain">/&gt;</code></div> <div class="line number100 index99 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;/form&gt;</code></div> <div class="line number101 index100 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;/td&gt;</code></div> <div class="line number102 index101 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;/tr&gt;</code></div> <div class="line number103 index102 alt2"> <code class="php plain">&lt;/table&gt;</code></div> <div class="line number104 index103 alt1"> <code class="php plain">&lt;table width=</code><code class="php string">"50%"</code><code class="php plain">&gt;</code></div> <div class="line number105 index104 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;tr&gt;</code></div> <div class="line number106 index105 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;td&gt;NO&lt;/td&gt;</code></div> <div class="line number107 index106 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;td&gt;ID BANK&lt;/td&gt;</code></div> <div class="line number108 index107 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;td&gt;NAMA BANK&lt;/td&gt;</code></div> <div class="line number109 index108 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;td&gt;AKSI&lt;/td&gt;</code></div> <div class="line number110 index109 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;/tr&gt;</code></div> <div class="line number111 index110 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;tr&gt;</code></div> <div class="line number112 index111 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;td colspan=</code><code class="php string">"4"</code><code class="php plain">&gt;&lt;hr/&gt;&lt;/td&gt;</code></div> <div class="line number113 index112 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;/tr&gt;</code></div> <div class="line number114 index113 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;?php</code></div> <div class="line number115 index114 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$limit</code>&nbsp; <code class="php plain">= 5;</code></div> <div class="line number116 index115 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">if</code> <code class="php plain">(isset(</code><code class="php variable">$_REQUEST</code><code class="php plain">[</code><code class="php string">"namaBank"</code><code class="php plain">])){</code></div> <div class="line number117 index116 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$cari</code> <code class="php plain">= </code><code class="php string">"WHERE namaBank LIKE '%"</code><code class="php plain">.</code><code class="php variable">$_REQUEST</code><code class="php plain">[</code><code class="php string">"namaBank"</code><code class="php plain">].</code><code class="php string">"%'"</code><code class="php plain">;</code></div> <div class="line number118 index117 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">}</code><code class="php keyword">else</code><code class="php plain">{</code></div> <div class="line number119 index118 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$cari</code> <code class="php plain">= </code><code class="php string">""</code><code class="php plain">;</code></div> <div class="line number120 index119 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">}</code></div> <div class="line number121 index120 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$sql</code> <code class="php plain">= </code><code class="php string">"SELECT * FROM tRefBank "</code><code class="php plain">.</code><code class="php variable">$cari</code><code class="php plain">;</code></div> <div class="line number122 index121 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$exec</code> <code class="php plain">= </code><code class="php variable">$cn</code><code class="php plain">-&gt;execute(</code><code class="php variable">$sql</code><code class="php plain">);</code></div> <div class="line number123 index122 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$totalRecords</code> <code class="php plain">= </code><code class="php variable">$cn</code><code class="php plain">-&gt;record_count();</code></div> <div class="line number124 index123 alt1"> </div> <div class="line number125 index124 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">if</code> <code class="php plain">(!isset(</code><code class="php variable">$_REQUEST</code><code class="php plain">[</code><code class="php string">"page"</code><code class="php plain">]) || trim(</code><code class="php variable">$_REQUEST</code><code class="php plain">[</code><code class="php string">"page"</code><code class="php plain">]=</code><code class="php string">""</code><code class="php plain">) ){</code></div> <div class="line number126 index125 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$offset</code> <code class="php plain">= 0;</code></div> <div class="line number127 index126 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">}</code><code class="php keyword">else</code><code class="php plain">{</code></div> <div class="line number128 index127 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$offset</code> <code class="php plain">=</code><code class="php variable">$_REQUEST</code><code class="php plain">[</code><code class="php string">"offset"</code><code class="php plain">];</code></div> <div class="line number129 index128 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">}</code></div> <div class="line number130 index129 alt1"> </div> <div class="line number131 index130 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php comments">//$offset = (isset($_REQUEST["page"])? $_REQUEST["offset"]:0);</code></div> <div class="line number132 index131 alt1"> </div> <div class="line number133 index132 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$sql</code> <code class="php plain">= </code><code class="php string">"SELECT * FROM tRefBank "</code><code class="php plain">.</code><code class="php variable">$cari</code><code class="php plain">.</code><code class="php string">" LIMIT "</code><code class="php plain">.</code><code class="php variable">$offset</code><code class="php plain">.</code><code class="php string">", "</code><code class="php plain">.</code><code class="php variable">$limit</code><code class="php plain">;</code></div> <div class="line number134 index133 alt1"> </div> <div class="line number135 index134 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$exec</code> <code class="php plain">= </code><code class="php variable">$cn</code><code class="php plain">-&gt;execute(</code><code class="php variable">$sql</code><code class="php plain">);</code></div> <div class="line number136 index135 alt1"> </div> <div class="line number137 index136 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$i</code> <code class="php plain">= </code><code class="php variable">$offset</code><code class="php plain">;</code></div> <div class="line number138 index137 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">while</code><code class="php plain">(</code><code class="php variable">$r</code> <code class="php plain">= </code><code class="php variable">$cn</code><code class="php plain">-&gt;getArray()):</code></div> <div class="line number139 index138 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$i</code><code class="php plain">++;</code></div> <div class="line number140 index139 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">?&gt;</code></div> <div class="line number141 index140 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;tr&gt;</code></div> <div class="line number142 index141 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;td&gt;&lt;?php </code><code class="php functions">echo</code> <code class="php variable">$i</code><code class="php plain">;?&gt;&lt;/td&gt;</code></div> <div class="line number143 index142 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;td&gt;&lt;?php </code><code class="php functions">echo</code> <code class="php variable">$r</code><code class="php plain">[0];?&gt;&lt;/td&gt;</code></div> <div class="line number144 index143 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;td&gt;&lt;?php </code><code class="php functions">echo</code> <code class="php variable">$r</code><code class="php plain">[1];?&gt;&lt;/td&gt;</code></div> <div class="line number145 index144 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;td&gt;&lt;a href=</code><code class="php string">"&lt;?php echo $PHP_SELF;?&gt;?mode=edit&amp;kodeBank=&lt;?php echo $r[0];?&gt;"</code><code class="php plain">&gt;EDIT&lt;/a&gt; - &lt;a href=</code><code class="php string">"&lt;?php echo $PHP_SELF;?&gt;?mode=hapus&amp;kodeBank=&lt;?php echo $r[0];?&gt;"</code><code class="php plain">&gt;HAPUS&lt;/a&gt;&lt;/td&gt;</code></div> <div class="line number146 index145 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;/tr&gt;</code></div> <div class="line number147 index146 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;?php </code><code class="php keyword">endwhile</code><code class="php plain">; ?&gt;</code></div> <div class="line number148 index147 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;tr&gt;</code></div> <div class="line number149 index148 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;td colspan=</code><code class="php string">"4"</code><code class="php plain">&gt;</code></div> <div class="line number150 index149 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;?php </code><code class="php functions">echo</code> <code class="php variable">$cn</code><code class="php plain">-&gt;recordsetNav(</code><code class="php variable">$totalRecords</code><code class="php plain">, </code><code class="php variable">$PHP_SELF</code><code class="php plain">.</code><code class="php string">"?namaBank="</code><code class="php plain">.</code><code class="php variable">$_REQUEST</code><code class="php plain">[</code><code class="php string">"namaBank"</code><code class="php plain">].</code><code class="php string">"&amp;page="</code><code class="php plain">.</code><code class="php variable">$offset</code><code class="php plain">,</code><code class="php variable">$offset</code><code class="php plain">,</code><code class="php variable">$limit</code><code class="php plain">,</code><code class="php string">'10%'</code><code class="php plain">,</code><code class="php string">'yes'</code><code class="php plain">);?&gt;</code></div> <div class="line number151 index150 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;/td&gt;</code></div> <div class="line number152 index151 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">&lt;/tr&gt;</code></div> <div class="line number153 index152 alt2"> <code class="php plain">&lt;/table&gt;</code></div> </div> </td></tr> </tbody></table> </div> </div> Sementara berbeda dengan class yang diberikan pada artikel sebelumnya, kita tambahkan fungsi pagination :<br /> <div> <div class="syntaxhighlighter php" id="highlighter_257825"> <div class="toolbar"> <a class="toolbar_item command_help help" href="http://www.citstudio.com/articles/aplikasi-sederhana-php-mysql-select-insert-update-delete-searching-paging-menggunakan-konsep-oop/#">?</a></div> <table border="0" cellpadding="0" cellspacing="0"><tbody> <tr><td class="gutter"><div class="line number1 index0 alt2"> 1</div> <div class="line number2 index1 alt1"> 2</div> <div class="line number3 index2 alt2"> 3</div> <div class="line number4 index3 alt1"> 4</div> <div class="line number5 index4 alt2"> 5</div> <div class="line number6 index5 alt1"> 6</div> <div class="line number7 index6 alt2"> 7</div> <div class="line number8 index7 alt1"> 8</div> <div class="line number9 index8 alt2"> 9</div> <div class="line number10 index9 alt1"> 10</div> <div class="line number11 index10 alt2"> 11</div> <div class="line number12 index11 alt1"> 12</div> <div class="line number13 index12 alt2"> 13</div> <div class="line number14 index13 alt1"> 14</div> <div class="line number15 index14 alt2"> 15</div> <div class="line number16 index15 alt1"> 16</div> <div class="line number17 index16 alt2"> 17</div> <div class="line number18 index17 alt1"> 18</div> <div class="line number19 index18 alt2"> 19</div> <div class="line number20 index19 alt1"> 20</div> <div class="line number21 index20 alt2"> 21</div> <div class="line number22 index21 alt1"> 22</div> <div class="line number23 index22 alt2"> 23</div> <div class="line number24 index23 alt1"> 24</div> <div class="line number25 index24 alt2"> 25</div> <div class="line number26 index25 alt1"> 26</div> <div class="line number27 index26 alt2"> 27</div> <div class="line number28 index27 alt1"> 28</div> <div class="line number29 index28 alt2"> 29</div> <div class="line number30 index29 alt1"> 30</div> <div class="line number31 index30 alt2"> 31</div> <div class="line number32 index31 alt1"> 32</div> <div class="line number33 index32 alt2"> 33</div> <div class="line number34 index33 alt1"> 34</div> </td><td class="code"><div class="container"> <div class="line number1 index0 alt2"> <code class="php keyword">function</code> <code class="php plain">recordsetNav(</code><code class="php variable">$totalrecords</code><code class="php plain">,</code><code class="php variable">$page_url</code><code class="php plain">,</code><code class="php variable">$offset</code><code class="php plain">=0,</code><code class="php variable">$limit</code><code class="php plain">=0,</code><code class="php variable">$tablewidth</code><code class="php plain">=</code><code class="php string">'25%'</code><code class="php plain">,</code><code class="php variable">$verbiage</code><code class="php plain">=</code><code class="php string">'yes'</code><code class="php plain">){</code></div> <div class="line number2 index1 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain"># EXAMPLE USAGE: recordsetNav(</code><code class="php variable">$mysql_link</code><code class="php plain">,</code><code class="php variable">$users_query</code><code class="php plain">,</code><code class="php variable">$PHP_SELF</code><code class="php plain">,</code><code class="php variable">$offset</code><code class="php plain">,</code><code class="php variable">$limit</code><code class="php plain">,</code><code class="php string">'75%'</code><code class="php plain">,0); #</code></div> <div class="line number3 index2 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$pagenumber</code> <code class="php plain">= (</code><code class="php variable">$offset</code> <code class="php plain">+ </code><code class="php variable">$limit</code><code class="php plain">) / </code><code class="php variable">$limit</code><code class="php plain">;</code></div> <div class="line number4 index3 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$totalpages</code> <code class="php plain">= </code><code class="php functions">intval</code><code class="php plain">(</code><code class="php variable">$totalrecords</code><code class="php plain">/</code><code class="php variable">$limit</code><code class="php plain">);</code></div> <div class="line number5 index4 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">if</code> <code class="php plain">(</code><code class="php variable">$totalrecords</code><code class="php plain">%</code><code class="php variable">$limit</code> <code class="php plain">&gt; 0) </code><code class="php variable">$totalpages</code><code class="php plain">++;</code></div> <div class="line number6 index5 alt1"> </div> <div class="line number7 index6 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$navstring</code>&nbsp; <code class="php plain">= </code><code class="php string">"&lt;table align=\"center\" width=\""</code><code class="php plain">.</code><code class="php variable">$tablewidth</code><code class="php plain">.</code><code class="php string">"\" cellspacing=\"0\" cellpadding=\"1\" border=\"0\" align=center&gt;"</code><code class="php plain">;</code></div> <div class="line number8 index7 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php comments">// only show &lt;&lt;PREV NEXT&gt;&gt; row if $totalrecords is greater than $limit</code></div> <div class="line number9 index8 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">if</code> <code class="php plain">(</code><code class="php variable">$totalrecords</code> <code class="php plain">&gt; </code><code class="php variable">$limit</code><code class="php plain">){</code></div> <div class="line number10 index9 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$navstring</code> <code class="php plain">.= </code><code class="php string">"&lt;tr&gt;"</code><code class="php plain">;</code></div> <div class="line number11 index10 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">if</code> <code class="php plain">(</code><code class="php variable">$offset</code> <code class="php plain">!= 0){</code></div> <div class="line number12 index11 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$navstring</code> <code class="php plain">.= </code><code class="php string">"&lt;td valign='middle' width='25%' nowrap&gt;&lt;a class='small' href='"</code><code class="php plain">.</code><code class="php variable">$page_url</code><code class="php plain">.</code><code class="php string">"&amp;offset="</code><code class="php plain">.(</code><code class="php variable">$offset</code><code class="php plain">-</code><code class="php variable">$limit</code><code class="php plain">).</code><code class="php string">"'&gt; &amp;lt;&amp;lt; PREVIOUS&nbsp; &lt;/a&gt;&lt;/td&gt;"</code><code class="php plain">;</code></div> <div class="line number13 index12 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">}</code><code class="php keyword">else</code><code class="php plain">{</code></div> <div class="line number14 index13 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$navstring</code> <code class="php plain">.= </code><code class="php string">"&lt;td width='25%' nowrap&gt;&amp;nbsp;&lt;/td&gt;"</code><code class="php plain">;</code></div> <div class="line number15 index14 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">}</code></div> <div class="line number16 index15 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">if</code><code class="php plain">(</code><code class="php variable">$totalrecords</code><code class="php plain">-</code><code class="php variable">$offset</code> <code class="php plain">&lt;= </code><code class="php variable">$limit</code><code class="php plain">){</code></div> <div class="line number17 index16 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$navstring</code> <code class="php plain">.= </code><code class="php string">"&lt;td width='25%' nowrap&gt;&amp;nbsp;&lt;/td&gt;"</code><code class="php plain">;</code></div> <div class="line number18 index17 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">}</code><code class="php keyword">else</code><code class="php plain">{</code></div> <div class="line number19 index18 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$navstring</code> <code class="php plain">.= </code><code class="php string">"&lt;td align='right' valign='middle' width='25%' nowrap border=0&gt;&lt;a class='small' href='"</code><code class="php plain">.</code><code class="php variable">$page_url</code><code class="php plain">.</code><code class="php string">"&amp;offset="</code><code class="php plain">.(</code><code class="php variable">$offset</code><code class="php plain">+</code><code class="php variable">$limit</code><code class="php plain">).</code><code class="php string">"'&gt; NEXT &amp;gt;&amp;gt; &lt;/a&gt;&lt;/td&gt;"</code><code class="php plain">;</code></div> <div class="line number20 index19 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">}</code></div> <div class="line number21 index20 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$navstring</code> <code class="php plain">.= </code><code class="php string">"&lt;/tr&gt;"</code><code class="php plain">;</code></div> <div class="line number22 index21 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">}</code></div> <div class="line number23 index22 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php comments">//$navstring .= "&lt;tr&gt;&lt;td colspan='3' align='center'&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;";</code></div> <div class="line number24 index23 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">if</code> <code class="php plain">(</code><code class="php variable">$verbiage</code><code class="php plain">==</code><code class="php string">"no"</code><code class="php plain">){</code></div> <div class="line number25 index24 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$navstring</code> <code class="php plain">.= </code><code class="php string">""</code><code class="php plain">;</code></div> <div class="line number26 index25 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">}</code><code class="php keyword">else</code><code class="php plain">{</code></div> <div class="line number27 index26 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$navstring</code> <code class="php plain">.= </code><code class="php string">"&lt;tr&gt;&lt;td colspan='3' align='center' nowrap&gt;"</code><code class="php plain">;</code></div> <div class="line number28 index27 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$navstring</code> <code class="php plain">.= </code><code class="php string">"&lt;span class='RGBsmall'&gt;Pages: &lt;b&gt;"</code><code class="php plain">.</code><code class="php variable">$pagenumber</code><code class="php plain">.</code><code class="php string">"&lt;/b&gt;/&lt;b&gt;"</code><code class="php plain">.</code><code class="php variable">$totalpages</code><code class="php plain">.</code><code class="php string">"&lt;/b&gt;"</code><code class="php plain">;</code></div> <div class="line number29 index28 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$navstring</code> <code class="php plain">.= </code><code class="php string">"&amp;nbsp;&amp;nbsp; total Record(s): &lt;b&gt;"</code><code class="php plain">.</code><code class="php variable">$totalrecords</code><code class="php plain">.</code><code class="php string">"&lt;/b&gt;&lt;/span&gt;"</code><code class="php plain">;</code></div> <div class="line number30 index29 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$navstring</code> <code class="php plain">.= </code><code class="php string">"&lt;/td&gt;&lt;/tr&gt;"</code><code class="php plain">;</code></div> <div class="line number31 index30 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">}</code></div> <div class="line number32 index31 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable">$navstring</code> <code class="php plain">.= </code><code class="php string">"&lt;/table&gt;"</code><code class="php plain">;</code></div> <div class="line number33 index32 alt2"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword">return</code> <code class="php variable">$navstring</code><code class="php plain">;</code></div> <div class="line number34 index33 alt1"> <code class="php spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain">}</code></div> </div> </td></tr> </tbody></table> </div> </div> <h3> Comments</h3> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'><span class='post-author vcard'> Diposting oleh <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'> <meta content='https://www.blogger.com/profile/15869231707966236211' itemprop='url'/> <a href='https://www.blogger.com/profile/15869231707966236211' rel='author' title='author profile'> <span itemprop='name'>Unknown</span> </a> </span> </span> <span class='post-timestamp'> di <meta content='https://loebizpiss.blogspot.com/2012/11/aplikasi-sederhana-php-mysql-select.html' itemprop='url'/> <a class='timestamp-link' href='https://loebizpiss.blogspot.com/2012/11/aplikasi-sederhana-php-mysql-select.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2012-11-09T06:36:00-08:00'>06.36</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://loebizpiss.blogspot.com/2012/11/aplikasi-sederhana-php-mysql-select.html#comment-form' onclick=''> Tidak ada komentar: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-80050670'> <a href='https://www.blogger.com/post-edit.g?blogID=3945660030349696922&postID=212647234727762683&from=pencil' title='Edit Entri'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=3945660030349696922&postID=212647234727762683&target=email' target='_blank' title='Kirimkan Ini lewat Email'><span class='share-button-link-text'>Kirimkan Ini lewat Email</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=3945660030349696922&postID=212647234727762683&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=3945660030349696922&postID=212647234727762683&target=twitter' target='_blank' title='Bagikan ke X'><span class='share-button-link-text'>Bagikan ke X</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=3945660030349696922&postID=212647234727762683&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Berbagi ke Facebook'><span class='share-button-link-text'>Berbagi ke Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=3945660030349696922&postID=212647234727762683&target=pinterest' target='_blank' title='Bagikan ke Pinterest'><span class='share-button-link-text'>Bagikan ke Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'><span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'><span class='post-location'> </span> </div> </div> </div> </div> </div></div> </div> <div class='blog-pager' id='blog-pager'> <span id='blog-pager-older-link'> <a class='blog-pager-older-link' href='https://loebizpiss.blogspot.com/search?updated-max=2012-11-09T06:36:00-08:00&amp;max-results=7' id='Blog1_blog-pager-older-link' title='Postingan Lama'>Postingan Lama</a> </span> <a class='home-link' href='https://loebizpiss.blogspot.com/'>Beranda</a> </div> <div class='clear'></div> <div class='blog-feeds'> <div class='feed-links'> Langganan: <a class='feed-link' href='https://loebizpiss.blogspot.com/feeds/posts/default' target='_blank' type='application/atom+xml'>Postingan (Atom)</a> </div> </div> </div></div> </div> </div> <div class='column-left-outer'> <div class='column-left-inner'> <aside> </aside> </div> </div> <div class='column-right-outer'> <div class='column-right-inner'> <aside> <div class='sidebar section' id='sidebar-right-1'><div class='widget BlogArchive' data-version='1' id='BlogArchive1'> <h2>Arsip Blog</h2> <div class='widget-content'> <div id='ArchiveList'> <div id='BlogArchive1_ArchiveList'> <ul class='hierarchy'> <li class='archivedate expanded'> <a class='toggle' href='javascript:void(0)'> <span class='zippy toggle-open'> &#9660;&#160; </span> </a> <a class='post-count-link' href='https://loebizpiss.blogspot.com/2012/'> 2012 </a> <span class='post-count' dir='ltr'>(11)</span> <ul class='hierarchy'> <li class='archivedate expanded'> <a class='toggle' href='javascript:void(0)'> <span class='zippy toggle-open'> &#9660;&#160; </span> </a> <a class='post-count-link' href='https://loebizpiss.blogspot.com/2012/11/'> November </a> <span class='post-count' dir='ltr'>(11)</span> <ul class='posts'> <li><a href='https://loebizpiss.blogspot.com/2012/11/blog-post.html'>Tanpa judul</a></li> <li><a href='https://loebizpiss.blogspot.com/2012/11/membuat-website-itu-mudah-mengunakan.html'>Membuat Website Itu Mudah mengunakan Fremset</a></li> <li><a href='https://loebizpiss.blogspot.com/2012/11/manipulasi-data-mysql-dengan-php-select_9.html'>manipulasi data mysql dengan php - select insert u...</a></li> <li><a href='https://loebizpiss.blogspot.com/2012/11/aplikasi-sederhana-php-mysql-select.html'>Aplikasi Sederhana PHP-MySQL (Select, Insert, Upda...</a></li> <li><a href='https://loebizpiss.blogspot.com/2012/11/part-12-dari-rangkaian-tutorial.html'>PART 12 DARI RANGKAIAN TUTORIAL PEMBUATAN CMS SEDE...</a></li> <li><a href='https://loebizpiss.blogspot.com/2012/11/membuat-frame-tabel-html-dan-php.html'>Membuat frame tabel HTML dan PHP</a></li> <li><a href='https://loebizpiss.blogspot.com/2012/11/cara-membuat-frame-dengan-html.html'>Cara Membuat Frame dengan HTMl</a></li> <li><a href='https://loebizpiss.blogspot.com/2012/11/membuat-form-input-data-siswa-dengan.html'>Membuat Form Input Data Siswa dengan PHP dan MySQL</a></li> <li><a href='https://loebizpiss.blogspot.com/2012/11/membuat-database-melalui-phpmyadmin.html'>Membuat Database Melalui PHPMyAdmin</a></li> <li><a href='https://loebizpiss.blogspot.com/2012/11/pemrograman-web-1-modul-6-php-dan-mysql.html'>Pemrograman Web 1 : Modul 6. PHP dan MySQL</a></li> <li><a href='https://loebizpiss.blogspot.com/2012/11/membuat-pencarian-sederhana-dengan-php.html'>Membuat Pencarian Sederhana dengan PHP dan MySQL</a></li> </ul> </li> </ul> </li> </ul> </div> </div> <div class='clear'></div> </div> </div><div class='widget Profile' data-version='1' id='Profile1'> <h2>Kumpulan Modul Belajar Gwe Hehehehehee</h2> <div class='widget-content'> <dl class='profile-datablock'> <dt class='profile-data'> <a class='profile-name-link g-profile' href='https://www.blogger.com/profile/15869231707966236211' rel='author' style='background-image: url(//www.blogger.com/img/logo-16.png);'> Unknown </a> </dt> </dl> <a class='profile-link' href='https://www.blogger.com/profile/15869231707966236211' rel='author'>Lihat profil lengkapku</a> <div class='clear'></div> </div> </div></div> </aside> </div> </div> </div> <div style='clear: both'></div> <!-- columns --> </div> <!-- main --> </div> </div> <div class='main-cap-bottom cap-bottom'> <div class='cap-left'></div> <div class='cap-right'></div> </div> </div> <footer> <div class='footer-outer'> <div class='footer-cap-top cap-top'> <div class='cap-left'></div> <div class='cap-right'></div> </div> <div class='fauxborder-left footer-fauxborder-left'> <div class='fauxborder-right footer-fauxborder-right'></div> <div class='region-inner footer-inner'> <div class='foot no-items section' id='footer-1'></div> <table border='0' cellpadding='0' cellspacing='0' class='section-columns columns-2'> <tbody> <tr> <td class='first columns-cell'> <div class='foot no-items section' id='footer-2-1'></div> </td> <td class='columns-cell'> <div class='foot no-items section' id='footer-2-2'></div> </td> </tr> </tbody> </table> <!-- outside of the include in order to lock Attribution widget --> <div class='foot section' id='footer-3' name='Footer'><div class='widget Attribution' data-version='1' id='Attribution1'> <div class='widget-content' style='text-align: center;'> Tema Kelembutan. Diberdayakan oleh <a href='https://www.blogger.com' target='_blank'>Blogger</a>. </div> <div class='clear'></div> </div></div> </div> </div> <div class='footer-cap-bottom cap-bottom'> <div class='cap-left'></div> <div class='cap-right'></div> </div> </div> </footer> <!-- content --> </div> </div> <div class='content-cap-bottom cap-bottom'> <div class='cap-left'></div> <div class='cap-right'></div> </div> </div> </div> <script type='text/javascript'> window.setTimeout(function() { document.body.className = document.body.className.replace('loading', ''); }, 10); </script> <script type="text/javascript" src="https://www.blogger.com/static/v1/widgets/984859869-widgets.js"></script> <script type='text/javascript'> window['__wavt'] = 'AOuZoY6KRBR3JGdc5J3z_s97dHplIZ28OQ:1732142921501';_WidgetManager._Init('//www.blogger.com/rearrange?blogID\x3d3945660030349696922','//loebizpiss.blogspot.com/','3945660030349696922'); _WidgetManager._SetDataContext([{'name': 'blog', 'data': {'blogId': '3945660030349696922', 'title': 'Modul Belajar Gwe', 'url': 'https://loebizpiss.blogspot.com/', 'canonicalUrl': 'http://loebizpiss.blogspot.com/', 'homepageUrl': 'https://loebizpiss.blogspot.com/', 'searchUrl': 'https://loebizpiss.blogspot.com/search', 'canonicalHomepageUrl': 'http://loebizpiss.blogspot.com/', 'blogspotFaviconUrl': 'https://loebizpiss.blogspot.com/favicon.ico', 'bloggerUrl': 'https://www.blogger.com', 'hasCustomDomain': false, 'httpsEnabled': true, 'enabledCommentProfileImages': true, 'gPlusViewType': 'FILTERED_POSTMOD', 'adultContent': false, 'analyticsAccountNumber': '', 'encoding': 'UTF-8', 'locale': 'id', 'localeUnderscoreDelimited': 'id', 'languageDirection': 'ltr', 'isPrivate': false, 'isMobile': false, 'isMobileRequest': false, 'mobileClass': '', 'isPrivateBlog': false, 'isDynamicViewsAvailable': true, 'feedLinks': '\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22Modul Belajar Gwe - Atom\x22 href\x3d\x22https://loebizpiss.blogspot.com/feeds/posts/default\x22 /\x3e\n\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/rss+xml\x22 title\x3d\x22Modul Belajar Gwe - RSS\x22 href\x3d\x22https://loebizpiss.blogspot.com/feeds/posts/default?alt\x3drss\x22 /\x3e\n\x3clink rel\x3d\x22service.post\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22Modul Belajar Gwe - Atom\x22 href\x3d\x22https://www.blogger.com/feeds/3945660030349696922/posts/default\x22 /\x3e\n', 'meTag': '\x3clink rel\x3d\x22me\x22 href\x3d\x22https://www.blogger.com/profile/15869231707966236211\x22 /\x3e\n', 'adsenseHostId': 'ca-host-pub-1556223355139109', 'adsenseHasAds': false, 'adsenseAutoAds': false, 'boqCommentIframeForm': true, 'loginRedirectParam': '', 'view': '', 'dynamicViewsCommentsSrc': '//www.blogblog.com/dynamicviews/4224c15c4e7c9321/js/comments.js', 'dynamicViewsScriptSrc': '//www.blogblog.com/dynamicviews/4ff351627da87384', 'plusOneApiSrc': 'https://apis.google.com/js/platform.js', 'disableGComments': true, 'interstitialAccepted': false, 'sharing': {'platforms': [{'name': 'Dapatkan link', 'key': 'link', 'shareMessage': 'Dapatkan link', 'target': ''}, {'name': 'Facebook', 'key': 'facebook', 'shareMessage': 'Bagikan ke Facebook', 'target': 'facebook'}, {'name': 'BlogThis!', 'key': 'blogThis', 'shareMessage': 'BlogThis!', 'target': 'blog'}, {'name': 'X', 'key': 'twitter', 'shareMessage': 'Bagikan ke X', 'target': 'twitter'}, {'name': 'Pinterest', 'key': 'pinterest', 'shareMessage': 'Bagikan ke Pinterest', 'target': 'pinterest'}, {'name': 'Email', 'key': 'email', 'shareMessage': 'Email', 'target': 'email'}], 'disableGooglePlus': true, 'googlePlusShareButtonWidth': 0, 'googlePlusBootstrap': '\x3cscript type\x3d\x22text/javascript\x22\x3ewindow.___gcfg \x3d {\x27lang\x27: \x27id\x27};\x3c/script\x3e'}, 'hasCustomJumpLinkMessage': false, 'jumpLinkMessage': 'Baca selengkapnya', 'pageType': 'index', 'pageName': '', 'pageTitle': 'Modul Belajar Gwe'}}, {'name': 'features', 'data': {}}, {'name': 'messages', 'data': {'edit': 'Edit', 'linkCopiedToClipboard': 'Tautan disalin ke papan klip!', 'ok': 'Oke', 'postLink': 'Tautan Pos'}}, {'name': 'template', 'data': {'name': 'Ethereal', 'localizedName': 'Kelembutan', 'isResponsive': false, 'isAlternateRendering': false, 'isCustom': false, 'variant': 'hummingBirds2', 'variantId': 'hummingBirds2'}}, {'name': 'view', 'data': {'classic': {'name': 'classic', 'url': '?view\x3dclassic'}, 'flipcard': {'name': 'flipcard', 'url': '?view\x3dflipcard'}, 'magazine': {'name': 'magazine', 'url': '?view\x3dmagazine'}, 'mosaic': {'name': 'mosaic', 'url': '?view\x3dmosaic'}, 'sidebar': {'name': 'sidebar', 'url': '?view\x3dsidebar'}, 'snapshot': {'name': 'snapshot', 'url': '?view\x3dsnapshot'}, 'timeslide': {'name': 'timeslide', 'url': '?view\x3dtimeslide'}, 'isMobile': false, 'title': 'Modul Belajar Gwe', 'description': '', 'url': 'https://loebizpiss.blogspot.com/', 'type': 'feed', 'isSingleItem': false, 'isMultipleItems': true, 'isError': false, 'isPage': false, 'isPost': false, 'isHomepage': true, 'isArchive': false, 'isLabelSearch': false}}]); _WidgetManager._RegisterWidget('_NavbarView', new _WidgetInfo('Navbar1', 'navbar', document.getElementById('Navbar1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HeaderView', new _WidgetInfo('Header1', 'header', document.getElementById('Header1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_BlogView', new _WidgetInfo('Blog1', 'main', document.getElementById('Blog1'), {'cmtInteractionsEnabled': false, 'lightboxEnabled': true, 'lightboxModuleUrl': 'https://www.blogger.com/static/v1/jsbin/2646514562-lbx.js', 'lightboxCssUrl': 'https://www.blogger.com/static/v1/v-css/1964470060-lightbox_bundle.css'}, 'displayModeFull')); _WidgetManager._RegisterWidget('_BlogArchiveView', new _WidgetInfo('BlogArchive1', 'sidebar-right-1', document.getElementById('BlogArchive1'), {'languageDirection': 'ltr', 'loadingMessage': 'Memuat\x26hellip;'}, 'displayModeFull')); _WidgetManager._RegisterWidget('_ProfileView', new _WidgetInfo('Profile1', 'sidebar-right-1', document.getElementById('Profile1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_AttributionView', new _WidgetInfo('Attribution1', 'footer-3', document.getElementById('Attribution1'), {}, 'displayModeFull')); </script> </body> </html>