questions:
id | question
answers:
id | question_id | answer
answer_user
answer_id | user_id (или question_id | answer_id | user_id)
<?php
$my_var = [1, 2, 3, 4];
<?php
require "file1.php";
class MyClass {
public function c()
{
global $my_var;
var_dump($my_var);
}
}
// ...
$input = $request->all();
$validator = new OrderValidator($input);
if ($validator->fails())
// ошибка, обрабатываем
$model = new Order;
$model->create($input);
$images = $data->find('#content div table td a[target=_blank]');
if (isset($images[6])
{
// скачиваем
}
// Включаем отображение ошибок
ini_set('display_errors', true);
error_reporting(E_ALL);
Связывает PHP переменную с именованным или неименованным параметром подготавливаемого SQL запроса. В отличие от PDOStatement::bindValue(), переменная привязывается по ссылке, и ее значение будет вычисляться во время вызова PDOStatement::execute().