0

Подключаю

<?php 
    require "libs/rb.php";
    R::setup( 'mysql:host=localhost;dbname=users',
        'root', '' );
?>

и он мне выводит ошибку

Parse error: syntax error, unexpected T_STRING in Z:\home\localhost\www\TPL\libs\rb.php on line 3

открываю файл rb.php, смотрю на первые строки

<?php

namespace RedBeanPHP {

/**
 * RedBean Logging interface.
 * Provides a uniform and convenient logging
 * interface throughout RedBeanPHP.
 *
 * @file    RedBean/Logging.php
 * @author  Gabor de Mooij and the RedBeanPHP Community
 * @license BSD/GPLv2
 *
 * @copyright
 * copyright (c) G.J.G.T. (Gabor) de Mooij and the RedBeanPHP Community
 * This source file is subject to the BSD/GPLv2 License that is bundled
 * with this source code in the file license.txt.
 */

третья строка namespace RedBeanPHP {

Понять не могу, в чём проблема.

1
  • Неймспейсы появились в РНР 5.3. Очевидно, этот код запускается на более старой версии. 15 фев 2019 в 15:31

1 ответ 1

-2
<?php 
    require "libs/rb.php";

    $db = [
    'dsn' => 'mysql:host=loc`введите сюда код`alhost;dbname=name;charset=utf-8',
    'user' => 'login',
    'pass' => 'password'
    ];

    R::setup($db['dsn'], $db['user'], $db['pass']);

?>

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.