MYSQL Trigger

Mungkin saya adalah salah satu orang yang ketinggalan info soal MYSQL, terlebih lagi soal MYSQL TRIGGER…apa itu??

Memang sudah 3 tahun ini saya tidak bermain-main dengan fungsi MYSQL yang advance, biasanya pake query-query standar saja, jadi maklum jika MYSQL TRIGGER sampe sekarang belum ngerti :D

MYSQL TRIGGER, mungkin kalo di ORACLE disebut STORE PROCEDURE.
Perintah TRIGGER adalah suatu PROCEDURE di MYSQL yang berfungsi secara otomatis menjalankan query tertentu. Trigger akan berjalan ketika “pemicu” nya dipanggil.

Sebagai contoh, Server akan mengupdate secara otomatis pada tabel B jika  “row” di tabel A di hapus..

di sesi berikutnya akan saya sajikan bagaimana contoh Mysql Triggernya…

 

CSS Hack: Fixing IE z-index with Javascript Library

CSS HACK: MEMPERBAIKI Z-INDEX IE DENGAN JAVASCRIPT

Berikut ini bukan solusi “segala-galanya” untuk memperbaiki tingkah aneh z-index pada IE, akan tetapi pasti dapat membantu “keruwetan” tersebut.

jQuery:

$(function() {        var zIndexNumber = 1000;        
// Put your target element(s) in the selector below!        
$("div").each(function() {                
$(this).css('zIndex', zIndexNumber);                
zIndexNumber -= 10;        
});
});

Mootols:

if(Browser.Engine.trident){        var zIndexNumber = 1000;        
// Put your target element(s) in the selector below!        $$('div').each(function(el,i){                el.setStyle('z-index',zIndexNumber);                zIndexNumber -= 10;        }); };

Prototype:

var zIndexNumber = 1000; $$("div").each(function(e) { e.setStyle({ zIndex: zIndexNumber }); zIndexNumber -= 10; });
 Semoga bermanfaat…

 

 

 

Mengurus Perpanjangan STNK 5 Tahun

Bagaimana Cara Mengurus Perpanjangan STNK?

Apakah Motor Anda sudah mencapai usia 5 Tahun? Jika YA, Ayo!inilah saatnya kita melakukan perpanjangan perpanjangan STNK sekaligus bayar pajaknya ya. Jika Anda belum paham atau belum mengerti Cara mengurusnya, Cukup bawa motor/kendaraan milik Anda ke SAMSAT wilayah Anda. Kali ini saya mengurusnya di Kantor SAMSAT Kabupaten Malang, letaknya di wilayah Kecamatan Karang Ploso.
[ad#link-vehicle]
Kantor SAMSAT Kabupaten Malang Karangploso ini cukup mudah untuk dijangkau dengan menggunakan kendaraan pribadi.

  • Jika Anda dari arah Batu dan Karang Ploso, teruskan perjalanan Anda ke menuju Arah Karanglo (Bentoel). Setelah Anda melewati Warung Pak Sholeh, kemudian SPBU Pertama setelah Karang Ploso, kurangi Laju kendaraan Anda. Kantor SAMSAT Kabupaten Malang terletak di sisi Kanan hanya beberapa meter setelah SPBU tersebut.
  • Jika Anda dari Arah Malang Kota / Karang Lo, Anda perlu memperhatikan bahwa letak Kantor SAMSAT Kabupaten Malang berada pada sisi Kiri Jalan Raya, diantara Masjid dan SPBU yang telah saya sebutkan sebelumnya. (Kalo bingung mendingan cari aja dulu SPBU seblum Karang Ploso) hehehehe

Oke Kembali ke masalah cara mengurus STNK tadi…
[ad#link-vehicle]
Jangan lupa bawa BPKB dan KTP yang masih berlaku. Jika atas nama orang lain, bawa surat kuasa dari pemilik.

  • Antrikan kendaraan untuk digesek petugas nomor rangka dan nomor mesinnya . Sambil menunggu antrian, beli map dan fotokopi BPKB, STNK dan KTP anda.
  • Kemudian belilah formulir gesek. Isi formulirnya dengan data-data dari STNK Anda.
  • Berikan kepada petugas yang menggesek untuk dilengkapi dan diberi paraf.
  • Kembalikan formulir ke loket untuk disahkan.
  • Bawa formulir yang telah disahkan tadi untuk membayar TNKB.
  • Setelah itu isi berkas dan bawa berkas-berkas ke loket PENOMORAN untuk pengecekan BPKB.

Dari Loket PENOMORAN, bawa berkas ke loket PENDAFTARAN STNK 5 tahun. Tunggu di depan KASIR 3 untuk membayar pajak. Kemudian tunggu lagi nama Anda dipanggil untuk mengambil STNK dan PLAT NOMOR yang baru.

Menurut peraturan RI No 50 tahun 2010, untuk cetak STNK 5 tahun, biayanya adalah:

Cetak STNK: 50,000

Cetak TNKB: 30,000

Dan total biaya yang saya keluarkan:

Beli map 2,000

Fotokopi 5,000

Formulir gesek 10,000

Pengesahan 16,000

Beli form TNKB dan bayar 80,000

Pajak kendaraan 205,000

Total biaya= 318,000

Total waktu yang dihabiskan 1 jam dari target yang ditetapkan di papan pengumuman 30 menit saja.

Bingung?  Selalulah bertanya agar tidak terkena jebakan calo.
[ad#link-vehicle]
Okedeh, selamat Memperpanjang STNK Kendaraan Anda!

 

Sumber :

- Pengalaman Pribadi

- Bloggerngalam.com

How To Display Error on PHP

I wondered why my php script doesn’t show errors like it did before. It seems my server configuration has default config set not to show the errors. I use the error message and notification for development.

Here’s how to override it without change server httpd configuration

Write this script below on your script…

error_reporting(E_ALL);
ini_set('display_errors', '1');

And all error and notification would be show up after it

Happy coding!

Backup Database on PHP And MySQL

Today i write script to backup all database on MySQL

first you must define your MySQL connection properties:

$dbhost=”localhost”;
$dbuser=”root”;
$dbpass=”yourpassword”;

then write then connection

$connect=@mysql_connect($dbhost,$dbuser,$dbpass);

after it you could write this

$query=@mysql_query(“show databases”,$connect);
$j=1;
$numdb=@mysql_num_rows($query);

$tanggal = date(“Y-m-d-H-i-s”);
$folder=”backup-”.$tanggal;
mkdir($folder);
for($j=1;$j<=$numdb;$j++){
$dbnm=@mysql_fetch_row($query);
//$db_array=$database.”[".$j."]“;
$db_name=$dbnm[0];
$db_array[$i]=$db_name;

$backupfile=$folder.”/”.$db_array[$i].”.sql”;
echo $backupfile.”<br/>”;
$command = “mysqldump –opt -h “.$dbhost.” -u “.$dbuser.” -p”.$dbpass.” “.$db_array[$i].” > “.$backupfile;

system($command);

}

save it on your php file, and ready run on your webserver.

How to Archiving in Centos

Compressing with Tar

Tar files place several files or the contents of a directory or directories in one file. This is a good way to create backups and archives. Usually, tar files end with the .tar extension.

To create a tar file, type:

tar -cvf filename.tar files/directories

In this example, filename.tar represents the file you are creating and files/directories represents the files or directories you want to put in the new file.

You can use absolute or relative pathnames for these files and directories (for more on pathnames. Separate the names of files and directories with a space.

The following input would create a tar file using absolute pathnames:

	 tar -cvf foo.tar /home/mine/work /home/mine/school

The above command would place all the files in the /work subdirectory and the /school subdirectory in a new file called foo.tar in the current working directory.

The command tar -cvf foo.tar file1.txt file2.txt file3.txt would place file1.txt, file2.txt and file3.txt in a new file called foo.tar.

To list the contents of a tar file, type:

	tar -tvf foo.tar

To extract the contents of a tar file, type:

tar -xvf foo.tar

This command does not remove the .tar file, but it places copies of the .tar contents in the current working directory.

The tar command does not compress files automatically. You can compress tar files with:

tar -czvf foo.tar

Compressed tar files are conventionally given the extension .tgz and are compressed with gzip.

To expand a compressed tar file type:

tar -xzvf foo.tgz

Compressing with Gzip and Zip

Gzip
Type the following command to compress a file at a shell prompt
gzip filename.ext -> The file will be compressed and saved as filename.ext.gz

Type the following command to expand a compressed file
gunzip filename.ext.gz -> The filename.ext.gz is deleted and replaced with filename.ext

Type the following command to compress multiple files at a shell prompt
gzip filename.gz file1 file2 file3 -> will compress file1, file2, file3 and put them in filename.gzip.

Zip
Type the following command to compress a file at a shell prompt

zip -r filename.zip files

filename represents the file you are creating and files represents the files you want to put in the new file

Type the following command to expand a compressed file

unzip filename.zip

Type the following command to compress multiple files at a shell prompt

zip filename.zip file1 file2 file3

will compress file1, file2, file3 and put them in filename.zip

If you add directory to multiple files

zip filename.zip file1 file2 file3 /user/work/school

will compress file1, file2, file3, the contents of the /user/work/school directory and put them in filename.zip

How To Tar.gz

If you are in the same directory as where your files / folders are placed, then you dont have to specify the file location. i.e. /usr/home/bleh/bleh
This is how to make a .tar.gz from a Folder

tar czf /path/to/output/folder/filename.tar.gz /path/to/folder

i.e if you are in /path/to/output/ and you want to put the file in /path/to/output/ you can use the following command.

tar czf filename.tar.gz folder

This is how to extract a .tar.gz file

gunzip -c /path/to/folder/filename.tar.gz

or like i do…

tar -zxvf /path/to/folder/filename.tar.gz

i.e if you are in /path/to/folder/ You can do the following…

tar -zxvf filename.tar.gz

View a list of all files in a .tar.gz archive

gunzip -c /path/to/folder/filename.tar.gz | tar -tvf -

i.e if you are in /path/to/folder/ You can do the following…

gunzip -c filename.tar.gz | tar -tvf -

Extract a single file from a .tar.gz file

gunzip -c /path/to/folder/filename.tar.gz | tar -xvf - path/within/archive/filename.php

i.e if you are in /path/to/folder/ You can do the following…

gunzip -c filename.tar.gz | tar -xvf - path/within/archive/filename.php

You can also add a date stamp to the tarball by using the following example below…

tar -czf public_html-`date +%d%m%y`.tar.gz public_html

HACK TIME DELAY RAPIDSHARE.COM

Kalo kita sering download lagu, film, software mungkin pasti kita kenal dengan Rapidshare.com. Rapidshare adalah salah satu provider sharing file, dimana kita bisa berbagi dengan orang lain. Kalo gak ada duit kita bisa pake fasilitas yang FREE, namun jika Anda punya uang yang lebih, mungkin Anda bisa membeli Vouchernya di beberapa penyedia Voucher Rapidshare, di Indonesia ada kok.

Saya tidak membahas tentang voucher, namun saya akan membahas, tentang fasilitas gratisan rapidshare. Dan tentunya Anda tahu bahwa setiap kali download beberapa file dari rapidshare, kita diminta untuk menunggu, kadang sampe nyebelin waktu tunggunya lama banget….

Nah, bro! saya kemarin menemukan trik untuk mempercepat waktu tunggu rapidshare tersebut. Dengan sedikit akal-akalan, anda dapat menghack “Download Time Waiting” atau waktu tunggu download. Caranya? MUDAH SEKALEEEE!!!

  1. Buka halaman download file RapidShare atau 4shared
  2. Klik tombol “Free User” (RapidShare) atau “Download” (4Shared)
  3. Saat waktu tunggu sedang berjalan, ketikkan kode berikut ini pada Address Bar Browser anda:


javascript:var c=0

atau


javascript:alert(c=0)

Selamat mencoba bro! semoga bermanfaat, dan please tinggalin komen donk

sumber : http://www.mydigitallife.info/2006/03/11/crack-rapidshare-time-delay-and-download-limit/