mysqli_query($connect, "UPDATE `news` SET `title` = '$_POST[n_title]', `short_content` = '$_POST[n_short_content]', `full_content` = '$_POST[n_content]' WHERE `id`='$_POST[n_id]' ");
UPDATE `blah` SET `isDeleted` = ?, `modify_date` = ? WHERE author_id = ?
-------------------------------------------------------
| id | is_deleted | modify_date | author_id |
-------------------------------------------------------
| 1 | f | 2017-01-02 | 1 |
-------------------------------------------------------
| 2 | f | 2017-01-02 | 1 |
-------------------------------------------------------
| 5 | f | 2017-01-02 | 3 |
-------------------------------------------------------
WHERE author_id = 1
, то UPDATE обновит несколько записей. security:
# ***
firewalls:
# ***
refresh:
pattern: ^/api/v1/token/refresh
stateless: true
anonymous: true
# ***
api:
pattern: ^/api
stateless: true
guard:
authenticators:
- lexik_jwt_authentication.jwt_token_authenticator
<?php
function connectDB() {
try {
$pdo = new PDO('mysql:host=localhost;dbname=#', 'root', '');
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
return $pdo;
} catch (PDOException $e) {
exit($e->getMessage());
}
}
function getA() {
$pdo = connectDB();
$select = $pdo->query("SELECT * FROM # ORDER BY id DESC", PDO::FETCH_ASSOC);
$result = $select->fetchAll();
var_dump($result);
}
getA();
?>
var listt = new List<string>();
System.Threading.Tasks.Parallel.For(0, 30, (iter,state) => {
System.Threading.Thread.Sleep(iter*500);
iter.Dump("Iter");
lock(ListSyncer)
{
listt.Add(iter.ToString());
}
});
static readonly object ListSyncer = new object();
IEnumerable<int> Range(int fromInclusive, int toExclusive)
{
for (var i = fromInclusive; i < toExclusive; i++) yield return i;
}
void Main()
{
var listt = new List<string>();
var range = Range(0, 30);
System.Threading.Tasks.Parallel.ForEach(range, (iter,state) => {
System.Threading.Thread.Sleep(iter*500);
iter.Dump("Iter");
lock(listt) {
listt.Add(iter.ToString());
}
});
listt.Dump();
}
// Define other methods and classes here