Sk8rRIMuk
asked on
PHP, MySQL and a Blog Archive
Alright then, I am having a problem that may seem trivial to the experts out there but it is really annoying me, and I am not sure what too doad.
So, heres the problem. I have designed a blog script, comment system and ACP (admin control panel) for my rather simple site as a test of what I can do: http://www.entrai.com/
I plan to create an archive script for but I am suck on what code to use, the only mysqlIi know is what I have learn't directly through php books, so it's not very indepth.
My code so far is:
<?php
include('db_connect.php');
$date = $_POST['date'] // format YYYYMM i.e. 200502
$archive_query = 'SELECT * FROM entai_blogs WHERE...';
?>
That's all I can think of, is their anyway that somebody can suggest to use a YYYYMM format string too select that year and month from a table that has a blogDate field in the format YYYY-MM-DD?
I doubt it's that hard but I will give 500 points for anybody that can help.
~ Craig
So, heres the problem. I have designed a blog script, comment system and ACP (admin control panel) for my rather simple site as a test of what I can do: http://www.entrai.com/
I plan to create an archive script for but I am suck on what code to use, the only mysqlIi know is what I have learn't directly through php books, so it's not very indepth.
My code so far is:
<?php
include('db_connect.php');
$date = $_POST['date'] // format YYYYMM i.e. 200502
$archive_query = 'SELECT * FROM entai_blogs WHERE...';
?>
That's all I can think of, is their anyway that somebody can suggest to use a YYYYMM format string too select that year and month from a table that has a blogDate field in the format YYYY-MM-DD?
I doubt it's that hard but I will give 500 points for anybody that can help.
~ Craig
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, that so helped :)
~ Craig
~ Craig
http://www.php.net/manual/en/function.date.php
Atan Asfaloth