HI ya everybody,
I've a very big task before me and i aint sure how shld i do this one??I display records from a table and i want to print the date on each record.To be more precisely, I display for example 20 records(with rec_id 1 to 20) everyday.First few records will have todays date and next few records will have yesterdays date and so on.Tomorrow, I display 20 more records(with rec_id 21 to 40).So everyday, I need to show that days date on the first few records and the previous date and so on.
I would be glad if somebody can help me.
Many many thanks
Heres the code how i display my records everyday.Here i need to append the code for my date concept.Please help me
//Lets get the weekday
$today = getdate();
$day = $today['weekday'];
//Lets Select the records from the table based on the weekday
switch($day)
{
case "Monday":
$query="SELECT id,introtext,zipcode,image,telephone,description FROM tbl_personals ORDER BY id Limit 20";
$numresults=mysql_query($query,$connection);
$numrows=mysql_num_rows($numresults);
break;
// and so on with the other week days.
}
// We carry out the table population using a 'while' loop
while ($row=mysql_fetch_array($result))
{
$var_7=$row["id"];
$var_1=$row["introtext"];
$var_2=$row["zipcode"];
$var_3=$row["image"];
$var_4=$row["telephone"];
$var_6=$row["description"];
// Display the results