Tampilkan postingan dengan label mysql. Tampilkan semua postingan
Tampilkan postingan dengan label mysql. Tampilkan semua postingan

Minggu, Januari 08, 2012

MySQL : mysqldump with -w option on Windows XP

Case : You have a big size of mysql database table on windows xp machine and you want to dump database table with "where" condition
Solution : using -w option

set_time_limit(0);

$username = "root";
$password = "toor";
$hostname = "localhost";
$sConnString = mysql_connect($hostname, $username, $password)
 or die("Unable to connect to MySQL");

$connection = mysql_select_db("Country",$sConnString)
 or die("Could not select DB");

$sql = "select * from tblkelurahan where left(KelurahanID,4)='3277'";
$query = mysql_query($sql);

while ($fetch = mysql_fetch_object($query)) {
 $namafile = $fetch->KelurahanID;
 $command = "C:xampp\\mysql\\bin\\mysqldump.exe --add-drop-table -uroot -ptoor -w\"KelurahanID='$namafile'\" Indonesia tblpenduduk > $namafile.sql";
 system($command);
}

Senin, September 26, 2011

phpMyAdmin : How to Import Large CSV

Case : You have a big file size csv to import to mysql using phpmyadmin
Solution : Use mysql script instead of import form from phpmyadmin (that will save you a lot of time)
Script :
LOAD DATA LOCAL INFILE 'file_name.csv'
INTO TABLE table_name
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
(column1,column2,column3);


Note : place your csv file in your phpmyadmin directory

Source : http://www.phpfreaks.com/forums/index.php?topic=343906.0

Rabu, Januari 26, 2011

JQuery : Delete row and fade out the row affected

Case : You want to delete row without refreshing whole page
Solution : Use JQuery


function hapus(id){
if (confirm('Yakin mau dihapus ???')) {
$.post('actions/hapus_pengeluaran.php', {id: +id, ajax: 'true' },
function(){
$("#row_"+id).fadeOut("slow");
});
}
}


Source : http://www.bitsntuts.com/css/simple-jquery-delete-table

Jumat, Desember 17, 2010

PHP MySQL JQuery - Autocomplete







http://www.uri.edu/blog/2009/06/08/auto-complete-with-jquery-php-and-mysql/