Jump to content

PHP errors


sp@rky13

Recommended Posts

So I'm doing this to import and unzip a text file:

 

cd www/tw/data/9 && rm village.txt.gz ; wget http://en9.tribalwars.net/map/village.txt.gz && rm village.txt ; gunzip village.txt.gz

 

And then to put it into a database I tried this but it failed:

 

$connection = mysql_connect("*********","********","*********");
mysql_select_db("********", $con);
mysql_query("TRUNCATE `village9`");
$load = mysql_query("LOAD DATA LOCAL INFILE '../data/9/village.txt' INTO TABLE `village9` FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (id, name, x, y, owner, points, rank)");
if (!$load) {
    die('Invalid query: ' . mysql_error());
}

 

Anyone see the problem?

Link to comment
https://forums.phpfreaks.com/topic/187221-php-errors/
Share on other sites

Im' doing it as a cron job and get this error:

 

/bin/sh: -c: line 0: syntax error near unexpected token `('

/bin/sh: -c: line 0: `$connection = mysql_connect("*********","********","*********");

mysql_select_db("********", $con);

mysql_query("TRUNCATE `village9`");

$load = mysql_query("LOAD DATA LOCAL INFILE '../data/9/village.txt' INTO TABLE `village9` FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (id, name, x, y, owner, points, rank)");

if (!$load) {

    die('Invalid query: ' . mysql_error());

}

Link to comment
https://forums.phpfreaks.com/topic/187221-php-errors/#findComment-988682
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.