jsonb_set(ExternalUrls, '{0,Url}', '"https://example/browse/CP-12"')
- заменит ключ Url в элементе с индексом 0 массива из ExternalUrls. Она возвращает новый JSONB объект, обновление колонок таблиц в SQL в любом случае делается через UPDATE:UPDATE ExternalWorkItems
SET ExternalUrls = jsonb_set(ExternalUrls, '{0,Url}', '"https://example/browse/CP-12"');
{*,Url}
, чтобы поменять сразу все элементы массива ExternalUrls (если у вас их там больше одного).UPDATE ExternalWorkItems
SET ExternalUrls = jsonb_set(
ExternalUrls, '{0,Url}',
to_jsonb(replace(ExternalUrls #>> '{0,Url}', 'test', 'example'))
);
UPDATE ExternalWorkItems SET ExternalUrls = replace(ExternalUrls::text, 'https://test', 'https://example')::jsonb;
include_path = ".;c:\php\includes"
-c
request.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');
Warning: When using FormData to submit POST requests using XMLHttpRequest or the Fetch_API with the multipart/form-data Content-Type (e.g. when uploading Files and Blobs to the server), do not explicitly set the Content-Type header on the request. Doing so will prevent the browser from being able to set the Content-Type header with the boundary expression it will use to delimit form fields in the request body.
WCHAR className[255];
GetClassNameW(GetConsoleWindow(), className, 255);
wprintf(L"%s", className);
s = [int(n) for n in s.split()]
+-----------------+----------+----------------+-----------------+
| achievements_id | users_fk | type | date |
+-----------------+----------+----------------+-----------------+
| 1 | 1 | 1 | 2021-10-01 |
| 2 | 2 | 1 | 2021-10-04 |
| 3 | 1 | 2 | 2021-10-08 |
| 4 | 1 | 4 | 2021-10-15 |
+-----------------+----------+----------------+-----------------+
+-----------------+-----------+----------------+-----------------+
| achieve_prop_id | acieve_fk | type | value |
+-----------------+-----------+----------------+-----------------+
| 1 | 1 | 1 | 'abc' |
| 2 | 2 | 1 | '145' |
+-----------------+-----------+-----------------+----------------+
gener=connection.escape(gener)
вы получаете в запросе LIKE "%'blabla'%"
.def escape(self, obj, mapping=None):
"""Escape whatever value is passed.
Non-standard, for internal use; do not use this in your applications.
"""
cursor.execute(script.format(year_from=args.year_from,
year_to=args.year_to,
name="%{}%".format( (args.regexp.translate(str.maketrans({'%': '\%', '_': '\_'})),) ),
gener="%{}%".format( (gener.translate(str.maketrans({'%': '\%', '_': '\_'})),) ),
rating=1,
N=args.N))
SELECT m.title, year, avg(r.rating)
FROM movies AS m
JOIN rating AS r
ON m.movie_id = r.movie_id
WHERE m.year BETWEEN {year_from} and {year_to} AND m.title LIKE {name} AND m.genres LIKE {gener}
GROUP BY r.movie_id, m.title, m.year
HAVING avg(r.rating) > {rating}
ORDER BY avg(r.rating) DESC, m.year DESC, m.title asc
LIMIT {N};
$ctx = stream_context_create(array("ssl" => array("capture_peer_cert" => TRUE)));
$sock = stream_socket_client("ssl://www.google.com:443", $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $ctx);
$cert = stream_context_get_params($sock);
$certinfo = openssl_x509_parse($cert['options']['ssl']['peer_certificate']);
// print_r($certinfo);
print "Valid from: " . date_create_from_format("ymdHise", $certinfo["validFrom"])->format("c")
. "\nValid till: " . date_create_from_format("ymdHise", $certinfo["validTo"])->format("c") . "\n";