W
W
WalkersRei2018-02-08 00:56:54
MySQL
WalkersRei, 2018-02-08 00:56:54

Inserting an array into a database?

When you run the script, the data should be updated in the database, but for some reason not

<?php
include $_SERVER['DOCUMENT_ROOT']."/include/config.php";
$text = '/check c465ea378a4f'; 
preg_match('~/check ([a-z0-9]+)~i', trim($text), $preg); 
print_r($preg);
foreach ($preg as $key => $value) {
$sql = $db->query('UPDATE `orders` SET `chat_id` = 123456 WHERE `orders`.`identify` = "'.$value.'"');	
}
//echo print_r($preg);
//$idet = 1;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2018-02-08
@dimonchik2013

decompose
the regexp separately
enter separately
then join

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question