Forum Moderators: coopster
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/select.css" />
</head>
<body>
<?php
$con = mysql_connect("localhost","user","pass");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("application", $con);
$result = mysql_query("SELECT * FROM applications");
?>
<div id="content">
<img src="images/eialogo.jpg" />
<div class="header">Name</div>
<div class="header">Surname</div>
<div class="header">Application date</div>
<div class="header">Date of birth</div>
<div class="header">Phone number</div>
<?php
while($row = mysql_fetch_array($result))
{
echo "<div class='input'>";
echo $row['first_name'];
echo "</div>";
echo "<div class='input'>";
echo $row['surname'];
echo "</div>";
echo "<div class='input'>";
echo $row['date_application'];
echo "</div>";
echo "<div class='input'>";
echo $row['date_of_birth'];
echo "</div>";
echo "<div class='input'>";
echo $row['phone_1'];
echo "</div>";
echo "<br />";
}
?>
<div id="clearfooter"></div>
</div>
<div id="footer"></div>
<?php
mysql_close($con);
?>
</body>
</html>
//once you have the desired data here, format it in HTML as you did before
echo "<pre>";
print_r($result);
echo "</pre>";
I usually just do a str_replace(" ", "_", $row['first_name']) purely for that reason - but that's just my preference.
echo "<pre>";
print_r($result);
echo "</pre>";
That's weird, I wonder why they index better?
by the way, what would you say is a really good source for learning, I use w3schools a lot to read about different things but I could be missing out some other good websites...