2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

フォーム作ってたらArray to string conversion (0)って言われた

Last updated at Posted at 2019-04-05

#配列から文字列に変換できないよ
直訳しただけだけど、そのまま意味

##原因
配列と文字列、両方の値を持っている

変数
a 1000
b 2000
c 3000
d 0 => "1000"
e 0 => "2000"

##解決
abcのように、deも文字列なら受け取れたが、
配列の場合は、1:nの関係になり、
1:1のデータベースでは受け取れないので
中間テーブルを作る。

中間テーブルの記事書いた↓
https://qiita.com/kusano00/items/001bdc353136935bf4f4

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?