Answers for "sqlstate[42000]: syntax error or access violation: 1072 key column 'id_usulan' doesn't exist in table"

PHP
1

Syntax error or access violation: 1072 Key column 'user_id' doesn't exist in table (SQL: alter table `groups` add constraint `groups_user_id_foreign` foreign key (`user_id`) references `users` (`id`))

// You forgot to create the column before creating the relationship
// Do something like (add unsigned before the relationship):

$table->integer('user_id')->unsigned();
$table->foreign('user_id')->references('id')->on('users');
Posted by: Guest on December-19-2020
1

SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and it must be defined as a key"

$table->integer('thnajrn_id', 10)->unsigned();
to
$table->integer('thnajrn_id')->unsigned();
or try
table->integer('thnajrn_id')->length(10)->unsigned();
Posted by: Guest on October-12-2021

Code answers related to "sqlstate[42000]: syntax error or access violation: 1072 key column 'id_usulan' doesn't exist in table"

Browse Popular Code Answers by Language