среда, 6 февраля 2013 г.

Ограничение времени соединения через file-get-contents

Ограничение времени соединения через file-get-contents

ini_set('default_socket_timeout',    120);


http://php.net/manual/en/function.file-get-contents.php
http://stackoverflow.com/questions/10189232/file-get-contents-timeout

суббота, 12 января 2013 г.

perl+SQL

http://citforum.ru/database/mysql/intro/

Введение в MySQL (используя Perl DBI)


use DBI;

my $dsn = 'DBI:mysql:my_database:localhost';
my $db_user_name = 'admin';
my $db_password = 'secret';
my ($id, $password);
my $dbh = DBI->connect($dsn, $db_user_name, $db_password);

my $sth = $dbh->prepare(qq{select id, password from users where nickname = $input_nickname});
$sth->execute();

-обработка-

my (@matrix) = ();
while (my @ary = $sth->fetchrow_array())
{
    push(@matrix, [@ary]);  # [@ary] это ссылка
}
$sth->finish();



$dbh->disconnect();