Hi all,
Am going mad trying to get something to work.
I'm creating a CMS for a magazine. The magazine is published every 2 months and therefore the edition is nov-dec or jan-feb etc.
I've an archive option on the site and rather than listing:
dec
nov
oct
sept etc
I'd like to follow the magazine editions:
nov-dec
sept-oct
The code I have so far is:
echo '<p>Sort By:</p>';
$year = date("Y"); //get the current year
$startDate = "1 january".$year; // set the end date to current year
function printMonths($var)
{
$start = strtotime($var); //timestamp of the entered date
$now = strtotime("Now"); //timestamp of now so it does not write anything in the future
while ($now > $start) //while the start is less than now
{
echo '<a href="news_archive.php?s=&id=' . get_id() . '&month=' . date("F", $now) .'">'.date("F", $now).'</a>';
echo " | ";
$now = strtotime("-1 month", $now); // subtract a month from the start timestamp
}
}
printMonths($startDate); //execute the function
this works well listing the months from the current month back. But this is not what I need. If I alter the line
$now = strtotime("-1 month", $now);
to
$now = strtotime("-2 month", $now);
It starts in Nov and goes back to sept which is not right. It also doesn't show nov-dec etc.
Any help on this is much appreciated
MFC GUI Programming
I am working on a project right now that requires me to create a MFC Windows GUI. Basically it needs to be able to pop up after hitting a button from another main application which would also be a
mysql select query problem
how can i select multiple fields from multiple table in one query likei have table name t1 and t2t1 fields are f_id,f_name,f_dest2 fields are f_id,ft_name,ft_desi need query which select f_id from
listing help
Hi,at first, great new design!!! I like it,i got a problem,I want to list some tekst, but there is a users, users can list they own texts, and all teksts, and find words in all texts and in own
mysql UNION | warning mysql_fetch_array !!
Code: <?php $i = 0; $query1="SELECT * FROM `products` WHERE `division`='$f_usr_div' ORDER BY `pname` UNION SELECT `stock_close` FROM `stockiest_entry` WHERE
how to populate a drop down box
Hi buddies!
How to use php and sql to check if values match the ones in a table (for logins)
How would I code it that the script takes two variables that are passed to it (UserID and PIN), and checks the table to see if the PIN matches the one in the table. If it does it should assign the
imap: how to save a copy of sent emails to sent elements
Hello my friends,I am writing an online emailing application with inbox outbox/sent elements etc.When I send and email with mail() function, what would I do in order to save to the sent
Need help in log in and log out?
hi there all of u. i have recently created a site for someone. i have placed log in and log out and some links . but those sessions are not working correctly when some one sign in and sign out and
Structure Question - One Table or One Table Per Record Set?
I have a web app (mySQL and PHP) which allows people to create an item with up to 200 records which I store in a single table. Any user subscribing to that item will be pulling up to 4 records from
iMatch stored value with the current value in a loop
Hello,I have a MySQL db were I store articles in.I have a form to fill these articles, and in that form I can select images who are stored into a directory. Selecting the images works good but the