我的PHP代码出了什么问题? 无法看到错误,因为它正在创建服务器错误

Working on some PHP, and keep encountering the Server error 500.

Here's my code, what am I doing wrong? I've tried a lot, but I have a feeling it's to do with line 17. I'm a novice coder, so I'm probably doing something simply wrong but any help is appreciated.

$category_id = '';
if( isset( $_GET['id'])) {
    $category_id = $_GET['id'];
}

for($i = 1; $i < sizeof($category_id); $i++);

include('dbconnect.php');
$title = "SELECT * FROM categories WHERE id = '$i'";
$stmt = $db->prepare($title);
$stmt->execute();
$result = $stmt->fetchAll();
$title = $result(1('name'));
include('base-template.php');

Errors

  1. Missing {} in for loop
  2. for loop never ends with ; at end
  3. Each and every time you are including dbconnect.
  4. $category_id should define as array
  5. $result(1('name')) is unclear. No idea what you expect too

Check Fred-ii comment on your question