「Warning: Invalid argument supplied for foreach() in・・・」エラーの修正方法