Database Connectionhttps://laravel.com/docs/5.7/eloquent
By default, all Eloquent models will use the default database connection configured for your application. If you would like to specify a different connection for the model, use the $connection property
Using Multiple Database Connectionshttps://laravel.com/docs/5.7/database#using-multip...
When using multiple connections, you may access each connection via the connection method on the DB facade. The name passed to the connection method should correspond to one of the connections listed in your config/database.php configuration file
INSERT INTO games (one, two, three) VALUES (1, 2, 3), (4, 5, 6), (7, 8, 9);
https://dev.mysql.com/doc/refman/5.7/en/insert.html WHERE city = 'Милан' > AVG(result)Что вы пытались здесь написать? Это выражение невалидно, потому и ошибка. Синтаксис условия в JOIN тоже неправильный, там какие-то колонки должны сравниваться, а вы название таблицы написали ещё раз.
printf("%s (%s)\n",$r["name"],$r["author"]);
Где у вас переменная-то определена с именем $r
? Правильно - нигде, потому и падает всё. $itog['name']
должно быть.select id, name
from department
where id in (
select department_id
from employee
group by department_id
having count(*) <= 3
)
Множественные запросы, или мультизапросы, должны запускаться функцией mysqli_multi_query().php.net/manual/ru/mysqli.quickstart.multiple-state...
MySQL requires indexes on foreign keys and referenced keys so that foreign key checks can be fast and not require a table scan. In the referencing table, there must be an index where the foreign key columns are listed as the first columns in the same order. Such an index is created on the referencing table automatically if it does not exist. This index might be silently dropped later, if you create another index that can be used to enforce the foreign key constraint. index_name, if given, is used as described previously.https://dev.mysql.com/doc/refman/5.7/en/create-tab...
MySQL requires indexes on foreign keys and referenced keys so that foreign key checks can be fast and not require a table scan. In the referencing table, there must be an index where the foreign key columns are listed as the first columns in the same order. Such an index is created on the referencing table automatically if it does not exist. This index might be silently dropped later, if you create another index that can be used to enforce the foreign key constraint. index_name, if given, is used as described previously.https://dev.mysql.com/doc/refman/5.7/en/create-tab...
срочно нужно нормально решениеИзмените структуру БД. Другого решения тут просто быть не может.
$results[0]->{'COUNT(user_id)'}
$results = $wpdb->get_results("
SELECT COUNT(user_id) as `count`
FROM `wp_konkurs`
WHERE ( `user_email` = 'mail@mail.ru' ) AND ( DATE(user_time) = ' $nowDate ' ) ;
");
var_dump($results[0]->count);
Добрые люди, подскажите, где найти мне это описание на диске?Это просто файлики Битрикса, которые они ведут самостоятельно, не нужно их править.