Tutoriale PHP
  Comunitatea PHP Romania

 
Tutoriale PHP
Exemple PHP
Categorii Exemple » Exemplu

SQL Dump


Descriere:
Folosind un dump de MySQL, scriptul il parsuieste si il introduce
Trimis de:admin
Voturi:14566
Accesari:2996

Sintaxa:
<?php 
// open the .sql file 
$fp = @fopen("mysql.sql""r"); 
$file fread($fp80000); 
fclose($fp); 

$lines explode(';'$file); // split the .sql into sepearte queries 
$cnt count($lines); // count array elements 

// database connection string 
mysql_connect("localhost","root"); 

// loop each query and execute 
for($j=0; ($j<$cnt-1); $j ) { 
if(!
mysql_query($lines[$j])) { 
// echo any errors 
echo "Error on line $j of Query:<br>"
echo 
$lines[$j]."<br><Br>"
die; 


// show confirmation 
echo "Done"
?> 

Ultimele discutii in forum RSS Forum

Ultimele articole Ultimele articole

Top membri

Pirahna Pirahna
la birou
carco carco
Bucuresti
Birkoff Birkoff
Bucuresti
mihaitha mihaitha
Sibiu
Mascka Mascka
Braila
gabysolomon gabysolomon
Bacau
whooper whooper
Toronto ON
raul_ raul_
dechim dechim
Drobeta Turnu Severin
Amenthes Amenthes

Newsletter


Email:
 inscriere
 renuntare
 
 Arhiva newsletter

Site-ul lunii

blg
 Blgpunctro

Propune un site

Online

242 utilizatori online

Parteneriat



Copyright © 2001-2008 PHP Romania Add PHPRomania to Google Add PHPRomania to Del.icio.us Add PHPRomania to Stumbleupon Add PHPRomania to Yahoo! Add PHPRomania to Digg Add PHPRomania to Blink Loans | Advertising | Myspace Layouts | Duwayne Burnside | Cheap Car Insurance
Ads: Partener Way2Web Nework: gazduire web | inregistrare domenii | web design | imobiliare | web hosting
Powered by Simplis