V
V
Vasily Pupkin2017-06-11 09:04:46
PHP
Vasily Pupkin, 2017-06-11 09:04:46

After ftp_get db_query doesn't work, why?

$conn = ftp_connect($this->ftp);
if (ftp_login($conn, $this->login, $this->password)) {
    ftp_chdir($conn, $this->folder);
    // скачивается XML файл весом в 250mb 
    //ftp_get($conn, 'temp/' . $server_file, $server_file, FTP_BINARY)
}
ftp_close($conn);
...
// если раскомментировать ftp_get то db_query не добавляет запись
// и даже в sql лог не пишется ничего и db_insert_id = 0 
db_query("insert into options (name, sort_order) values('data', '0')");
$optionID = db_insert_id();

PHP version 5.3.29 engine is very old.
How to get around the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Fuze, 2017-06-11
@HectorPrima

Or in PHP file try
Either increase the mysql.connect_timeout option in php.ini, by default 60.
Or do a reconnect in the database query function, using, for example, this . At the same time, if ping did not help reconnect, then do a reconnect.

D
Dmitry, 2017-06-11
@thewind

And the db_query function doesn't use global $conn ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question