HI!
I'm working on a project for my portfolio...the class that I learned PHP in had a database that we were able to use an odbc connection, but now my web host only has sql databases, so I'm doing a crash course in learning sql!
I have pretty much figured things out, but my original code had the information printing out in two columns, based on if the set db ID# was odd or even, but I can't seem to get that function working again, and I've tried everything, but it is just stumping me!!! Any suggestions is very much appreciated!!!
CODE
$sql = "SELECT * FROM Directors ";
$myrecordset = mysql_query($sql, $connection) or die ("Could not execute sql: $sql");
?>
<head>
<title>Best Movie Directors</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="container">
<img src="images/banner.jpg" alt="banner">
<br /><br /><br /><br />
<?
echo "<table align=\"center\">";
while($row = mysql_fetch_array($myrecordset))
{
if ($row['DirectorID'] % 2)
{
print "<tr><td><a href= \"director.php?DirectorID=".$row['DirectorID']."\">".$row['ButtonUp']."</a></td>";
}
else
{
print "<tr><td><a href= \"director.php?DirectorID=".$row['DirectorID']."\">".$row['ButtonUp']."</a></td></tr>";
}
}
echo "</table>";
?>
</div>
</body>
</html>
Thanks!