banner.php

<link href="../style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
</style>
 

<div id="banner">
	
	<div class="headerStyle">
    <div style="padding:4px 0px;">&nbsp;Banner</div>
    </div>
<?php
	
	include('koneksi.php');
	
	$result = mysql_query("SELECT gambar FROM banner");
	
	while ($data = mysql_fetch_array($result)){
		echo "<img src="$data['gambar']">".'<br>';
		}
		
?>

</div>

Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in C:\xampp\htdocs\php_template2\includes\banner.php on line 20

Line 20: echo "<img src="$data">".'<br>';

Why is it?

change it with this:

echo '<img src="'.$data['gambar'].'"><br>';

bye :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.