$url1arr = array_column($arr1, 'url');
foreach ($arr2 as $arr2s) {
$key = null;
$key = array_search( $arr2s['url'] , $url1arr );
//Если не нашел будет действие
if ( $key == false) {
var_dump ($arr2s);
}
}
$url1arr = array_column($arr1, 'url', 'url');
foreach ($arr2 as $arr2s) {
//Если не нашел будет действие
if (!isset($url1arr[$arr2s['url']])) {
var_dump ($arr2s);
}
}
<!DOCTYPE HTML>
<html>
<h1>
<form action="index.php" method="post">
Имя: <input type="text" name="username" value="<?php echo htmlspecialchars($_POST["name"]??''); ?>" /><br />
Email: <input type="text" name="email" value="<?php echo htmlspecialchars($_POST["email"]??''); ?>" /><br />
<input type="submit" name="submit" value="Отправь меня!" />
</form>
</h1>
</html>
$gorod = 'Moscow';
$query = "SELECT * FROM my WHERE gorod LIKE ?";
// get DB data using PDO
$stmt = $pdo->prepare($query);
$filter = "%$gorod%";
$stmt->execute([$filter]);
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
print_r($rows);
select json_arrayagg(
json_object(
'id', id,
'headlineEn', headlineEn,
'posttextEn', posttextEn
)
)
from posts;
$q = mysqli_prepare($connection, "INSERT INTO `user_value` (`user_name`, `user_pass`) VALUES (?, ?)");
$q->bind_param("ss", $user_names, $user_pass);
$q->execute();
но я же хочу через RedBean подключение к БДИ кто Вам мешает. Почитайте документацию RedBean в части взаимодействия с базой данных
$favorites = [103, 105];
$favorite_ids = implode(',', $favorites);
$query = sprintf('SELECT * FROM employees WHERE employee_id IN (%s)', $favorite_ids);
SELECT
p.*
FROM
products as p
WHERE
EXISTS (
SELECT 1 FROM product_filter pf WHERE pf.filter_id = 1 AND pf.product_id = p.id
)
AND EXISTS (
SELECT 1 FROM product_filter pf WHERE pf.filter_id = 2 AND pf.product_id = p.id
);
<?php
$mysqli->query("SET NAMES 'utf8'");
$mysqli->query("CREATE TABLE `geolocal` (
`id` INT AUTO_INCREMENT,
`names` VARCHAR(50),
`pass` VARCHAR(20),
`email` VARCHAR (50),
PRIMARY KEY(`id`)
)"
);
$mysqli->query(
"INSERT INTO `geolocal` (`names`, `pass`, `email`) VALUES ('spiderman', 'pautinka', 's.pider@list.ru')"
);
$mysqli->close();
$stmt = $mysqli->prepare("UPDATE req
SET balance = balance - ?
WHERE card =? AND code = ? ;");
$stmt->bind_param("sss", $cost, $card, $code);
// set parameters and execute
$cost = $_GET['cost'];
$card = $_POST['card'];
$code = $_POST['code'];
$stmt->execute();