udah pake yang phpmyadmin aja, tinggal export, file dump nya tinggal di
import ke local server
On 10/2/06, Irfani Firdausy <[EMAIL PROTECTED]> wrote:
>
> dear puji,
> ya betul kata dika pake phpmyadmin aja ( kalo mau under web based ). kalo
> mau pake mysql GUI coba pake navicat ( menurutku sih lebih bagus dari
> mysqlfront ).
> Untuk script aku dulu pernah bikin tapi masih under php 4 dan register
> global nya on hehhehe, googling aja ada kok.
> aku juga dulu nemu, tinggal modif2 dikit sesuai kebutuhan hehhe, ini
> scriptnya.
>
> <?php
> // ***********************************************************************
> // File backup_mydb.php programmed by : Irfani F ( [EMAIL
> PROTECTED]<irfani%40gmail.com>) Hak Cipta Dilindungi Undang-Undang
> // ***********************************************************************
>
> session_start();
> if(!session_is_registered("user_admin")){
> header("Location: login.php?msg=noaccess");
> die;exit;}
> if(!session_is_registered("password_admin")){
> header("Location: login.php?msg=noaccess");
> die;exit;}
> if($mod=="simpan")
> {
> @set_time_limit(600);
> $crlf="\n";
> $strNoTablesFound = "No tables found in database.";
> $strDumpingData = "Dumping data for table";
> $strError = "Error";
> $strSQLQuery = "SQL-query";
> $strMySQLSaid = "MySQL said: ";
> $strBack = "Back";
> $strDone = "On";
> $strat = "at";
> $tanggal = date ("Ymd_His");
> header("Content-disposition: filename=db_klien $tanggal.sql");
> header("Content-type: application/octetstream");
> header("Pragma: no-cache");
> header("Expires: 0");
> @include("../config.php");
> @include("../common.php");
> // doing some DOS-CRLF magic...
> $client = getenv("HTTP_USER_AGENT");
> if(ereg('[^(]*\((.*)\)[^)]*',$client,$regs))
> {
> $os = $regs[1];
> // this looks better under WinX
> if (eregi("Win",$os))
> $crlf="\r\n";
> }
>
> function my_handler($sql_insert)
> {
> global $crlf;
> echo "$sql_insert;$crlf";
> }
> function get_table_content($db, $table, $handler)
> {
> $result = mysql_db_query($db, "SELECT * FROM $table") or mysql_die();
> $i = 0;
> while($row = mysql_fetch_row($result))
> {
> $table_list = "(";
> for($j=0; $j<mysql_num_fields($result);$j++)
> $table_list .= mysql_field_name($result,$j).", ";
> $table_list = substr($table_list,0,-2);
> $table_list .= ")";
> if(isset($GLOBALS["showcolumns"]))
> $schema_insert = "INSERT INTO $table $table_list VALUES (";
> else
> $schema_insert = "INSERT INTO $table VALUES (";
> for($j=0; $j<mysql_num_fields($result);$j++)
> {
> if(!isset($row[$j]))
> $schema_insert .= " NULL,";
> elseif($row[$j] != "")
> $schema_insert .= " '".addslashes($row[$j])."',";
> else
> $schema_insert .= " '',";
> }
> $schema_insert = ereg_replace(",$", "", $schema_insert);
> $schema_insert .= ")";
> $handler(trim($schema_insert));
> $i++;
> }
> return (true);
> }
> function mysql_die($error = "")
> {
> echo "<b> $strError </b><p>";
> if(isset($sql_query) && !empty($sql_query))
> {
> echo "$strSQLQuery: <pre>$sql_query</pre><p>";
> }
> if(empty($error))
> echo $strMySQLSaid.mysql_error();
> else
> echo $strMySQLSaid.$error;
> echo "<br /><a href=\"javascript:history.go(-1)\">$strBack</a>";
> exit;
> }
> global $dbhost, $dbuser, $dbpass, $dbname;
> mysql_pconnect($dbhost, $dbuser, $dbpass);
> @mysql_select_db("$dbname") or die ("Unable to select database");
> $tables = mysql_list_tables($dbname);
> $num_tables = @mysql_numrows($tables);
> if($num_tables == 0)
> {
> echo $strNoTablesFound;
> }
> else
> {
> $i = 0;
> print "# ========================================================$crlf";
> print "# Database saved : $dbname $crlf";
> print "# Tanggal $tanggal $crlf";
> print "# ========================================================$crlf";
> print "$crlf";
>
> while($i < $num_tables)
> {
> $table = mysql_tablename($tables, $i);
> print "# $strDumpingData '$table'$crlf";
> print $crlf;
>
> get_table_content($dbname, $table, "my_handler");
> $i++;
> }
> }
> }
> ?>
>
> puj1 4nt0 <[EMAIL PROTECTED] <poejianto%40yahoo.co.id>> wrote:
> Database di Web Server adalah MySql dan mau aku export ke MySql Local
> Server..
> Teman2 Ada yang tau PHP Script-nya gak ya?
>
> PUJI
>
> MI-B 97
>
> ---------------------------------
> Apakah Anda Yahoo!?
> Kunjungi halaman depan Yahoo! Indonesia yang baru!
>
> [Non-text portions of this message have been removed]
>
> Regards,
> || ~Irfani Firdausy~ ||| http://irfani.ptmunibraw.org - We don't need a
> reason to help people - (by NeverMind)
>
>
> ---------------------------------
> Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+
> countries) for 2ยข/min or less.
>
> [Non-text portions of this message have been removed]
>
>
>
[Non-text portions of this message have been removed]
================> HAPUS IKLAN DIATAS DAN FOOTER INI JIKA ME-REPLY
<================
Posting : [email protected]
Archive : http://www.mail-archive.com/[email protected]/
www.mitek.unibraw.ac.id || himamitek.brawijaya.ac.id
************************************************************************************
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/mitek/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/mitek/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/