how do i echo out my data from data base
Posted: Mon Nov 23, 2009 3:46 pm
i want to pull each data row and display on page
heres my code im using
heres my code im using
Code: Select all
<?php
include_once 'Connect.php';
if (!is_authed())
{
die ('You are not permitted to view this page, <a href="../index.php">click here</a> to go back.');
}
$query = ("SELECT * FROM links ");
$result= mysql_query ($query) or die ('Could not query.');
while ($row = mysql_fetch_assoc($query))
{
$linkto = $row["linkto"];
$src = $row["src"];
$alt = $row["alt"];
$width = $row["width"];
$height = $row["height"];
$text = $row["text"];
}
?>
<html><head>
<link href="style.css" rel="stylesheet" type="text/css">
<script src="scripts/ShowHint.js" type="text/javascript"></script>
</head>
<body>
<div class=logo><?php include "logo.php";?></div>
<div class=navigationbarbox><?php include "navigationbar.php";?></div>
<div class=linkbanner><?php include "linkbanner.php";?></div>
<div class=linkform>
<a href="loginform.php">add a link</a>
<?php
echo "<a href="$linkto"><img src="$src" alt="$alt" width="$width" height="$height" border="0"></a><br>";
?>
</div>
<div class=footerbox><?php include "footer.php";?></div>
</body></html>