Ok Before you tell me to use mysqli I am using the depreciated methods on purpose for a webapp lesson. I am not a student, this is not homework, it is to help me teach an understanding for web application security.
I cannot figure out why this wont work. Basically, All I want to do is create a page that takes the data from the mysql database and places it into a table as shown. At this point I am open to anything.
Thank you in advance.
<html>
<head><title>Untitled</title></head>
<body>
<h1>Weblog Example</h1>
<dl>
<?php
mysql_connect("localhost","root","");
mysql_select_db("blog1");
$query ="SELECT entrytitle, entrytext,";
$query.=" DATE_FORMAT(entrydate, '%M %d, %Y') AS entrydate";
$query.=" FROM weblog ORDER BY entrydate DESC LIMIT 10";
$result=mysql_query($query);
?>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td width="15%" align="center" bgcolor="#E6E6E6"><strong>Title</strong></td>
<td width="75%" align="center" bgcolor="#E6E6E6"><strong>Entry</strong></td>
<td width="15" align="center" bgcolor="#E6E6E6"><strong>Date/Time</strong></td>
</tr>
<?php
while($rows=mysql_fetch_array($result)){
?>
<tr>
<td align="center" bgcolor="#FFFFFF"><? echo $rows['entrytitle']; ?></td>
<td align="center" bgcolor="#FFFFFF"><? echo $rows['entrytext']; ?></td>
<td align="center" bgcolor="#FFFFFF"><? echo $rows['entrydate']; ?></td>
</tr>
<?php
}
?>
</dl>
</body>
</html>
Ok- made some minor edits- it now gives me 3 rows in the table but doesn't populate the data...
</div>