简体   繁体   中英

POST http://localhost:8000/index/bots 500 (Internal Server Error)

I am still new in laravel and i got this message error when I am insert using query builder

POST http://localhost:8000/index/bots 500 (Internal Server Error)

and this is in controller

$countries = array("Australia","Japan","Mexico","United States","Italia","Greece","France","Hungary","Estados Unidos","Deutschland","United Kingdom");
            $country = $countries[rand(1,count($countries) - 1)];
            $deviceId = "";
              DB::table('players', 'stats')->insert(array(
                'dealerId' => '1',
                'username' =>  request('botName'),
                'player' => request('botName'),
                'banned' => '0',
                'approve' => '1',
                'winpot' => '100000',
                'deviceId' => '.$deviceId.',
                'myTime' => '0',
                'country' => '.$country.',
                'bot' => '1'
));

Generally, a 500 Internal Server means something went wrong on the server side. There are likely two causes for this in your situation:

  1. PHP encountered a syntax error.
  2. A problem exists between your PHP server and your database.

Check your PHP Server logs for more information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM