Php 快速语法问题

Php 快速语法问题,php,string,variables,header,Php,String,Variables,Header,我得到这个错误 分析错误:语法错误,意外的“”,应为“”,或在第7行的/storage/ssd2/202/1552202/public_html/randomreview.php中 我真的不知道怎么了 这是我的密码: <?php $db = new PDO('mysql:host=localhost;dbname=id1552202_accounts', 'id1552202_thecouch', 'Fargo123'); $random = $db->prepare("SEL

我得到这个错误

分析错误:语法错误,意外的“”,应为“”,或在第7行的/storage/ssd2/202/1552202/public_html/randomreview.php中

我真的不知道怎么了

这是我的密码:

<?php
 $db = new PDO('mysql:host=localhost;dbname=id1552202_accounts', 'id1552202_thecouch', 'Fargo123');
  $random = $db->prepare("SELECT path FROM Reviews ORDER BY RAND() LIMIT 1;");
      $random->execute();
 while($result = $random->fetch(PDO::FETCH_ASSOC)){ 
      $path = $result['path'];
      header('Location: https://thecouch.000webhostapp.com/'$path);
        }
?>

你忘了连接

header('Location: https://thecouch.000webhostapp.com/'.$path);
--------------------------------------------^-----


不需要;按兰德限制1查看订单的选择路径中的分号;;在限制1之后。并在标题中检查您的concate


也在标题后退出。按兰德限制1。。。。检查这个。。还有你的concate变量,字符串在7行中。。。标题行。
<?php
 $db = new PDO('mysql:host=localhost;dbname=id1552202_accounts', 'id1552202_thecouch', 'Fargo123');
  $random = $db->prepare("SELECT path FROM Reviews ORDER BY RAND() LIMIT 1");
      $random->execute();
 while($result = $random->fetch(PDO::FETCH_ASSOC)){ 
      $path = $result['path'];
      header('Location: https://thecouch.000webhostapp.com/'.$path);
        }
?>