Yii Framework Forum: Restore Database - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Restore Database Restore Database MySQL Rate Topic: -----

#1 User is offline   mrkoeh 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 31-October 12
  • Location:Indonesia

Posted 28 December 2012 - 03:39 AM

misi gan,
ada yang bisa bantu gak??
saya lagi bikin aplikasi dengan yii pastinya,
cm lgi terkendala saat melakukan restore database :

begini scriptnya :
public function actionRestore()
{
$model=new Restore;

if(isset($_POST['Restore']))
{
$model->attributes=$_POST['Restore'];
$models=CUploadedFile::getInstance($model,'filee');


$restore_obj = new MySQL_Restore();
//$restore_obj->server = 'localhost';
$dbUser = $restore_obj->username = 'root';
$dbPass = $restore_obj->password = '';
$dbName = $restore_obj->database = 'database';
$string = "D:\xampp\MySQL\bin\mysql -u".$dbUser." -p".$dbPass." ".$dbName." < ".$models;

if (!$restore_obj->Execute( $string,MSR_FILE,true, false))
{
die($restore_obj->error);
}
unlink($models);

$cs = Yii::app()->clientScript;
$cs->registerScript('my_script', 'if(confirm("Data Sukses Disimpan di Database!"))
window.location.href="index.php";
', CClientScript::POS_READY);

}
$this->render('Restore',array(
'model'=>$model,
));
}

upload berhasil, cm database gak bisa nambah,
apakah ada yang bisa membantu???
terimakasih. . . .
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users