小编Bla*_*ull的帖子

无法在ActiveRecord Yii2中插入数据库

我不知道什么是错的但我无法插入数据库.

这就是我在模型中得到的.

warranty.php

<?php

    namespace app\models;

    use Yii;
    use yii\db\ActiveRecord;
    use yii\behaviors\TimestampBehavior;
    use yii\db\Expression;
    use yii\helpers\VarDumper;
    /**
     * This is the model class for table "warrantytwo".
     *
     * @property integer $id
     * @property string $item_no
     * @property string $warranty_date
     * @property string $date
     * @property integer $created_by
     * @property string $tstamp
     */
    class Warrantytwo extends ActiveRecord
    {
        /**
         * @inheritdoc
         */
        public static function tableName()
        {
            return 'warrantytwo';
        }

        public function behaviors()
        {
            return [
                [
                    'class' => TimestampBehavior::className(),
                    'createdAtAttribute' …
Run Code Online (Sandbox Code Playgroud)

php mysql activerecord yii2

5
推荐指数
1
解决办法
727
查看次数

标签 统计

activerecord ×1

mysql ×1

php ×1

yii2 ×1