Invalid argument supplied for foreach()

Posted 2 months ago by davy_yg

Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\website_ids\IDS\recruitment.php on line 52

 <?php include("koneksi.php"); ?>

<?php $result = mysqli_query("SELECT * FROM tb_detail"); ?>

<?php foreach($result as $data){

            echo $data['position'];
        }

?>     

Any clue why the error appears?

Line 52: <?php foreach($result as $data){

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.