I am trying to make a script that takes my blog entry dates, anlyze them, strip off the year, and the months and then make links, so then when a blog carriest on to a new month, i dont have to make a link for old posts, etc.. so this is what i have so far,
mysql_connect(filteredout... this is not the problem)
mysql_select_db("blog");
$query = "select date from blog";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) {
while ($yearstripped = substr($row['date'],0,1,2,3)){
while ($monthstripped = substr($row['date'], 5,6)){
if ($monthstripped == 01) { $month = "january" ; }
if ($monthstripped == 02) { $month = "february" ; }
if ($monthstripped == 03) { $month = "march" ; }
if ($monthstripped == 04) { $month = "april" ; }
if ($monthstripped == 05) { $month = "may" ; }
if ($monthstripped == 06) { $month = "june" ; }
if ($monthstripped == 07) { $month = "july" ; }
if ($monthstripped == 08) { $month = "august" ; }
if ($monthstripped == 09) { $month = "september" ; }
if ($monthstripped == 10) { $month = "october" ; }
if ($monthstripped == 11) { $month = "november" ; }
if ($monthstripped == 12) { $month = "december" ; }
print $row['date'];
the errors i get are : Warning: Wrong parameter count for substr() in C:\FoxServ\www\includes\test.php on line 11 < repeated for every blog post i have. If someone has a better idea of how to do this then speak up, because right now mine has to check every single post for a date change...