Hi Everyone,
I am in the process of making my company's intranet more user friendly. When I started this project, I asked the employees what they would like to see in the intranet. One of those things happened to be display indicators on the homepage of the 6 most recent new or updated articles in the intranet so they don't have to look through the whole intranet to find new or updated information. I thought that was a great idea so I decided to attempt it but I've run into a problem.
In my database, I have two fields, timestamp and mod_timestamp. They are currently in the format of "04/9/06 - 4:43 pm" (which can change as long as the date and time are in there). Here is what I want to do, I want to be able to search the table called "content" for 6 articles that were either added or updated within lets say a week. Here is the code I have so far that works when the content is recently added but will not check for updated articles. I wasn't sure how to do that.
Thanks in advance for any help you can give me. Also, I am open to new ideas on how to approach this.
$resultID = mysql_query("SELECT * FROM content WHERE status = 'Live' ORDER BY contentid DESC LIMIT 0,6", $linkID);
echo '<table width="700" cellspacing="0" cellpadding="0" align="center" style="border:1px solid black">';
echo '<tr>';
print "<td align=\"left\" colspan=\"2\" style=\"border-bottom:1px solid black; padding:7.5px; background-color:#999999\"><font color=\"#000000\" size=\"2\"><strong>What's New @WORK?</strong></font></td>";
echo '</tr>';
while ($row = mysql_fetch_array($resultID)) {
echo '<tr>';
echo '<td style="background-color:#ffffff; padding:2px" width="59" align="center">';
if($row['mod_timestamp']!= "") {
echo '<img src="images/updated.gif"></a>';
}else{
echo '<img src="images/new.gif"></a>';
}
echo '</td>';
echo '<td style="background-color:#ffffff; padding:5px">';
echo '<a href="index.php?contentid='.$row['contentid'].'">';
echo $row['contentheader'];
echo '</a>';
echo '</td>';
echo '</tr>';
}
echo '</table>';
I am in the process of making my company's intranet more user friendly. When I started this project, I asked the employees what they would like to see in the intranet. One of those things happened to be display indicators on the homepage of the 6 most recent new or updated articles in the intranet so they don't have to look through the whole intranet to find new or updated information. I thought that was a great idea so I decided to attempt it but I've run into a problem.
In my database, I have two fields, timestamp and mod_timestamp. They are currently in the format of "04/9/06 - 4:43 pm" (which can change as long as the date and time are in there). Here is what I want to do, I want to be able to search the table called "content" for 6 articles that were either added or updated within lets say a week. Here is the code I have so far that works when the content is recently added but will not check for updated articles. I wasn't sure how to do that.
Thanks in advance for any help you can give me. Also, I am open to new ideas on how to approach this.
$resultID = mysql_query("SELECT * FROM content WHERE status = 'Live' ORDER BY contentid DESC LIMIT 0,6", $linkID);
echo '<table width="700" cellspacing="0" cellpadding="0" align="center" style="border:1px solid black">';
echo '<tr>';
print "<td align=\"left\" colspan=\"2\" style=\"border-bottom:1px solid black; padding:7.5px; background-color:#999999\"><font color=\"#000000\" size=\"2\"><strong>What's New @WORK?</strong></font></td>";
echo '</tr>';
while ($row = mysql_fetch_array($resultID)) {
echo '<tr>';
echo '<td style="background-color:#ffffff; padding:2px" width="59" align="center">';
if($row['mod_timestamp']!= "") {
echo '<img src="images/updated.gif"></a>';
}else{
echo '<img src="images/new.gif"></a>';
}
echo '</td>';
echo '<td style="background-color:#ffffff; padding:5px">';
echo '<a href="index.php?contentid='.$row['contentid'].'">';
echo $row['contentheader'];
echo '</a>';
echo '</td>';
echo '</tr>';
}
echo '</table>';