2017-04-15 8 views
0

私は、データベースに保存されたコードを使用してYouTubeの埋め込み動画を表示しようとしています。しかし、そのエラーを示しています。私は間違って何をしていますか?YouTubeのiframe動画(PHPを使用)

<?php 
    require 'db.php'; 
    $result = $mysqli->query("SELECT * FROM ycodes") or die($mysqli->error()); 
    $row = mysqli_fetch_array($result); 
    echo $row['ycode']; 
    ?> 


    <!DOCTYPE html> 
    <html> 
    <body> 
     <iframe width="560" height="315" src="https://www.youtube.com/embed/<?$row['ycode']?>" frameborder="0" allowfullscreen></iframe> 

    </body> 
    </html 

答えて

0
<iframe width="560" height="315" src="https://www.youtube.com/embed/<?$row['ycode']?>" frameborder="0" allowfullscreen></iframe> 

<iframe width="560" height="315" src="https://www.youtube.com/embed/<?php echo $row['ycode'];?>" frameborder="0" allowfullscreen></iframe> 
への変更
関連する問題