How to create table in JOHNCMS

478
.
Such is Life!
I am trying to create a four colum table in my post but I don't know how. 
.
Hey guys! Finally I'm gonna change status!?
xman, Native code
CREATE TABLE `tbl_name` (
  `col1` int(11) NOT NULL AUTO_INCREMENT,
  `col2` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `col3` int(11) NOT NULL,
  `col4` int(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
.
xman
Such is Life!
[c] # kantry ([time] 05/18/2021 07:47 AM [/ time])
xman, Native code
CREATE TABLE `tbl_name` (
  ` col1` int (11) NOT NULL AUTO_INCREMENT,
  `col2` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `col3` int (11) NOT NULL,
  ` col4` int (11) NOT NULL
) E [/ c] Thank you but I do not understand.

Attached bellow is what I want to do in my forum post and I am using JOHNCMS 9.xx
Прикрепленные файлы:
.
kantry
Hey guys! Finally I'm gonna change status!?
Добавлено: 18.05.2021 / 12:51
[/code][code=php]**************************************


Добавлено: 18.05.2021 / 12:55
Блин, когда Макс поймет что это гавно, а не редактор
CREATE TABLE `tbl_name` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `items` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `drafts` int(11) NOT NULL,
  `amounts` int(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
.
ginbert
# xman (18.05.2021 / 10:29)
I am trying to create a four colum table in my post but I don't know how. 
$schema = Capsule::schema();
        $schema->create(
            'demo_table',
            static function (Blueprint $table) {
                $table->increments('id'); // id column auto incre...
                $table->boolean('adm')->default(0)->index('adm');
                $table->integer('time')->unsigned()->default(0)->index('time');
                $table->integer('user_id')->unsigned()->default(0);
                $table->string('name')->default('');
                $table->text('text');
                $table->bigInteger('ip')->default(0)->index('ip');
                $table->string('browser')->default('');
                $table->string('admin')->default('');
                $table->text('otvet');
                $table->integer('otime')->unsigned()->default(0);
                $table->string('edit_who')->default('');
                $table->integer('edit_time')->unsigned()->default(0);
                $table->tinyInteger('edit_count')->unsigned()->default(0);
            }
        );

Using Eloquent
.
Such is Life!
Добавлено: 25.05.2021 / 16:59
ginbert, Thanks,  let me try it

Добавлено: 25.05.2021 / 22:23
I import the code above into my sql database but it only bring error, I am a novice when it comes to php please help me, explain better what I should do  with the code thanks in advance
.
Hey guys! Finally I'm gonna change status!?
xman, Example for Johncms version 9.4
https://github.com/johncms/joh ... 0.php
.
Such is Life!
Oh great thanks very much. Now I have another problem with JOHNCMS 9.4.1

I am stuck in step 3 installation process, please what should I do to make it work.
Attached below is where I am. 
Прикрепленные файлы:
.
Such is Life!
Добавлено: 26.05.2021 / 11:29
Ps: I am on shared hosting

Добавлено: 26.05.2021 / 12:09
Am also using php version 8
.
Hey guys! Finally I'm gonna change status!?
xman,
Максу 10 раз писал что из-за какой то мелочи, половина хостингов не подходит.

Find file the error, at the beginning of the file
$schema = Capsule::Schema();
Schema::defaultStringLength(191);// add string
Всего: 33