Database nasıl falaiyete geçireceğim
4
●475
- 16-03-2009, 22:31:35Kimlik doğrulama veya yönetimden onay bekliyor.
<?php // yedegin $file="yedek.sql"; // sql ayarları $server = "localhost"; // localhost. $data = "hikaye_veri"; // veritabanı $username = "hikaye_veri"; //veritabanı kullanıcı adı $password = "123456"; // şifre $linkq = @mysql_connect($server,$username,$password); mysql_select_db($data, $linkq); /////////////////////////// RESTORE \\\\\\\\\\\\\\\\\\\\\\\\ $ndfile = file($file); $type="NONE"; $drop_a=array(); $table_q=array(); $data_q=array(); $tables_q=0; echo "Đợi chút xíu nhe.........<br>"; foreach($ndfile as $line) { $line=chop($line); if ($type=="NONE") { if(strtolower(substr($line,0,6))=="insert") { $data_q[]=substr($line,0,strlen($line)-1); } elseif(strtolower(substr($line,0,6))=="create") { $type="TABLE"; $table_q[$tables_q]=$line."\n"; } elseif(strtolower(substr($line,0,4))=="drop") { $type="NONE"; array_push($drop_a, $line); } } elseif ($type=="TABLE") { if(strtolower(substr($line,0,1))==")") { $type="NONE"; $table_q[$tables_q] .= substr($line,0,strlen($line)-1)."\n"; $tables_q++; } else { $table_q[$tables_q] .= $line."\n"; } } } $sql_error=0; foreach($drop_a as $q_data) { if($q_data != "") { $q=mysql_query($q_data); if($q == 0) $sql_error=1; } } foreach($table_q as $q_data) { if($q_data != "") { $q=mysql_query($q_data); if($q == 0) $sql_error=1; } } foreach($data_q as $q_data) { if($q_data != "") { $q=mysql_query($q_data); if($q == 0) $sql_error=1; } } if($sql_error==1) { echo "hata"; echo mysql_error(); } else { echo "<center>Chúc mừng bạn, dữ liệu của bạn đã được retore.</center><br>\n"; } print("<br><br><br><center>.:: ::.</center> "); ?>bunu kullanabilirsin. veri.php diye bir dosya olustur bunları içine kopyala. kaydet. ftp ne at. veritabanınıda at ftp ye adını yedek.sql yap. veritabanı bilgilerini ayarladıktan sonra calıstır. sorunsuz şekilde yükler. - 16-03-2009, 23:40:10hocam paylaşımın için çok saol lakin bi sorun var, db bilgilerini sorunsuz girdim veri.php yi sorgulattım
SQL sorgunuzda bir hata varmış gibi gözüküyor.MySQL sunucu hata çıktısı,var ise,hatayı bulmanızda size yardımcı olabilir.
ERROR: Bilinmeyen noktalama işareti @ 1
STR: <?
SQL: <?php
$file="yedek.sql"
SQL sorgusu:
MySQL çıktısı:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<?php
$file="yedek.sql"' at line 1
böyle bi hata aldım.yardımcı olursanız çok sevinirim