U
U
Uniq2017-05-22 02:05:22
Perl
Uniq, 2017-05-22 02:05:22

Big mysql query how?

How to pass multiple actions to mysql in 1 request?
error:
DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
My code:

$sql = "UPDATE `ss` SET `available`='yes', `speed` = '' WHERE `id`= '';
UPDATE `ss` SET `available`='no' WHERE `id`= '';
UPDATE `ss` SET `available`='no' WHERE `id`= '';
UPDATE `ss` SET `available`='yes', `speed` = '' WHERE `id`= '';
UPDATE `ss` SET `available`='no' WHERE `id`= '';
UPDATE `ss` SET `available`='yes', `speed` = '' WHERE `id`= '';"
$sth = $dbh->prepare($sql);
 $sth->execute;
   $dbh->disconnect;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
Uniq, 2017-05-22
@padonnak

In general, what is all this for:
it turns out that ~ 50 threads work for me, each cycle makes about 2-3 thousand requests to the database in a cycle and the muscle stupidly falls, if the whole cycle is written to a string and then sent, this will simplify the task,
VPS 8gb ram 2 core - crashes from ram memory overflow, mysql clogs it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question