2

我的 Medoo 框架有问题,在 localhost (php > 5.4+) 上一切正常,但在我的服务器上我安装了 PHP 5.3+,你能帮我如何将此代码转换为旧数组版本并在 PHP 5.3 上执行代码。平台。

$database = new medoo array(
    // required
    'database_type' => 'mysql',
    'database_name' => 'mytable',
    'server' => 'localhost',
    'username' => 'root',
    'password' => '',

 // optional
    'port' => 3306,
    'charset' => 'utf8',
        'option' => [
        PDO::ATTR_CASE => PDO::CASE_NATURAL
    ]
);


$database->insert("table", [
    "project_name" => "Some text",
    "project_owner" => "Some Text",
    "project_time" => "10/10/2014",
    "project_target" => "- Target one, - Target two, - Target three",
    "project_details" => "This is my project."
]);
4

2 回答 2

3
<?php
require  'medoo.php';

$database = new medoo(array(
    'database_type' => 'mysql',
    'database_name' => 'test',
    'server' => 'localhost',
    'username' => 'testu',
    'password' => 'asdf'


));

$database->insert("table", array(
    "project_name" => "x",
    "project_owner" => "x",
    "project_time" => "x",
    "project_target" => "x",
    "project_details" => "x"
))
?>
于 2014-04-11T09:00:32.477 回答
2

用数组调用替换括号。所有的括号都是数组的简写形式。

http://www.php.net/manual/en/language.types.array.php

于 2014-04-10T21:46:18.990 回答