Answer the question
In order to leave comments, you need to log in
A bunch of exec() + mysqli_query(), what's going on here?
There is a large project with complex branched business logic, working in conjunction with php-fpm + nginx. Mysql is used as a database. And in this big project there is a small such problem, which, as such, does not relate to the project itself, but the project now relates to it. Very bad attitude.
So:
- there is an abstract table in the database `table` with fields `id` , `name`
- there is a simple php script that initializes the connection and tries to make a selection
<?php
//1.php
conn = mysqli_connect('localhost', 'user', 'pass', 'db_name');
$res = $conn->query('SELECT * FROM `table` WHERE `id` = 1');
var_dump($res);
mysqli_close($conn);
<?php
//2.php
exec('php -f 1.php', $output);
var_dump($output);
$conn->query('SELECT * FROM `table` WHERE `id` = 2'); // пользователя с ИД = 2 не существует
Answer the question
In order to leave comments, you need to log in
Vpindyur any you know, when changing the slide, change the content on the left and the numbers. And assign an additional class to the slide to increase it and set the background. slick will do it.
And you don't confuse anything? :)
Even if you make a syntax error in 1.php, then 2.php will work successfully and give it to you in the output:
php -f 2.php
array(2) {
[0]=>
string(0) ""
[1]=>
string(87) "Parse error: syntax error, unexpected ')' in 1.php on line 2"
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question