[ Príspevkov: 3 ] 
AutorSpráva
Offline

Užívateľ
Užívateľ
Obrázok užívateľa

Registrovaný: 02.09.08
Prihlásený: 23.01.13
Príspevky: 81
Témy: 17 | 17
NapísalOffline : 15.09.2008 11:22 | gzfile

ahojte, potrebujem help pri jednej veci. pomocou funkcie gzfile si otvaram subor a potom chcem udaje z neho zapisat do mysql. no gzfile mi hlasi chybu:

Warning: gzfile() expects parameter 2 to be long, string given in C:\wamp\www\DK\aktualizuj.php on line 3

tu je kod:

Kód:
<?php
 
  $lines = gzfile('http://cs5.ds.ignames.net/map/village.txt.gz', 'r');
  //if(!is_array($lines)) die("Soubor nelze otevřít");
  foreach($lines as $line) {
   list($id, $name ,$x, $y, $player, $points, $rank) = explode(',', $line);
   $name = urldecode($name);

   $name = addslashes($name);
   mysql_query("INSERT INTO villages SET id='$id', name='$name', x='$x', y='$y',
      player='$player', points='$points', rank='$rank'");
}
  echo 'data boli uspesne aktualizovane<br>';
  echo '<a href="index.php">vratit sa s5</a>';
 
?>


ten subor je z hry divoke kmene a mal by obsahovat cca. 173.376 riadkov. moze byt problem v tom?


Offline

Správca fóra
Správca fóra
gzfile

Registrovaný: 27.07.07
Príspevky: 3948
Témy: 51 | 51
Bydlisko: Bratislava
NapísalOffline : 15.09.2008 11:32 | gzfile

zle si si precital dokumentaciu k tej funkcii, mas chybny druhy parameter...


_________________
NTB: Acer Aspire 4820TG 14" | CPU: Intel Core i5 2,53 GHz | VGA: ATI Mobility Radeon HD5650 1GB | RAM: 8GB DDR3 1066 MHz | HDD: 1TB SSD WD BLUE
Offline

Užívateľ
Užívateľ
Obrázok užívateľa

Registrovaný: 02.09.08
Prihlásený: 23.01.13
Príspevky: 81
Témy: 17 | 17
Napísal autor témyOffline : 15.09.2008 13:17 | gzfile

vyriesene, dakujem pekne :oops:


 [ Príspevkov: 3 ] 


gzfile




© 2005 - 2026 PCforum, edited by JanoF