Ik maak een beheringssysteem maar ik heb een probleem, Als ik een variabele in een img zet dan doet hij het niet:
Het probleem:
Hier is het probleem: echo '<img src="$result[1].png">';
Wie kan uitleggen wat er mis is??
Alvast bedankt
Het probleem:
Code:
<?php
include_once("connect.php");
if(is_numeric($_GET['max'])) $max = $_GET['max'];
if(is_numeric($_GET['start'])) $start = $_GET['start'];
if (empty($max)) $max = 5;
if (empty($start)) $start = 0;
$end = $start + $max;
$prev = $start - $max;
$next = $end;
$query = mysql_query("SELECT id,datum,bericht,titel FROM nieuws ORDER BY id DESC LIMIT $start, $max") or die (mysql_error());
$num = mysql_num_rows($query);
if (empty($num))
{
echo "<p>Er zijn geen nieuwsberichten.</p>";
}
else
{
while ($result = mysql_fetch_row($query)) {
echo "<table border=\"0px\" width=\"400px\" >";
echo "<tr><td bgcolor='#52F3FF'><span style=\"color:#fff;\">$result[1]</span><br /></td></tr>";
echo "<tr><td>$result[2]</td></tr><br />";
echo '<img src="$result[1].png">';
echo '</table><br /><br /><br />';
}
echo "<p>\n";
if ($prev >= '0')
{
echo "[<a href=\"nieuws.php?start=$prev&max=$max\">Vorige</a>]\n";
} else {
echo "Vorige\n";
}
$count = mysql_fetch_row(mysql_query("SELECT count(*) FROM nieuws"));
$thispage = ceil($start/$max+1);
if ($count[0] > $max)
{
$total = ceil($count[0]/$max);
for($i=0;$i<$total;$i++)
{
$number = $i+1;
$start = $i*$max;
if ($thispage == $number)
{
echo "<strong>[<a href=\"nieuws.php?start=" . $start . "&max=" . $max . "\">" . $number . "</a>]</strong>\n";
} else {
echo "<a href=\"nieuws.php?start=" . $start . "&max=" . $max . "\">" . $number . "</a>\n";
}
}
}
if ($count[0] > $next)
{
echo "[<a href=\"nieuws.php?start=$next&max=$max\">Volgende</a>]\n";
} else {
echo "Volgende\n";
}
echo "</p>\n";
}
?>
Hier is het probleem: echo '<img src="$result[1].png">';
Wie kan uitleggen wat er mis is??
Alvast bedankt
