There is such a request. I wonder why it does not work.

$ cikl1 = mysqli_query ($ CONNECT, "SELECT first_name , last_name , photo , uidvk FROM users WHERE rotspisok = 1; UPDATE users SET rot = rot + 1 WHERE uidvk = 288988637");

  • one
    All these php libraries working with mysql perform only one request. make two hits, earns - splash58
  • That is, in the tail of the request, even the injection is not embedded? - PHPcoder

1 answer 1

Work through PDO, mysqli is already the last century, it seems that it is not even supported already. And yes, 1 expression = 1 request.

$ sql_select = "SELECT first_name, last_name, photo, uidvk FROM users WHERE rotspisok = 1"; $ sql_update = "UPDATE users SET rot = rot + 1 WHERE uidvk = 288988637";

mysqli_query ($ CONNECT, $ sql_select);

mysqli_query ($ CONNECT, $ sql_update);

  • 2
    mysqli is already the last century - I do not agree, the taste and color. Be careful with such statements! - borodatych
  • I recommend using PDO - fonjeekay
  • It is interesting, who is a plus for this deep nonsense about the last century? - Ipatiev
  • The @JuraZubach PHP API offers a choice of three sets of tools for connecting to a database server: PHP MySQL extension, PHP mysqli extension, PHP PDO data objects - and each of them has its own advantages and disadvantages. For example, PDO does not support all the functionality of MySQL 4.1+ multiple queries, unlike mysqli, and mysqli does not support client-side prepared requests, unlike PDOBlacknife