title date
-------------------------------
Gravity 01/08/2009
Science 02/15/2009
04/01/2009
Tech 05/05/2009
.
.
. (etc)
Notice that some entries have titles, some do not. ALL have a date.
So in my RSS feed I need a basic if statement that says, "If the title is present, use that as the title. Otherwise use the date as the title. For some reason in the database the title field is marked as blank, '', instead of being NULL.
Simple, no? But my little code isn't working! Here is what I have:
Code: Select all
if (strlen($_GET['title'])>1) { # if the length is greater than one
echo "<title>".$row['titledate']."</title>\n"; # Display the date value
} else { # Otherwise...
echo "<title>".$row['title']."</title>\n"; # Display the title value
}
Thanks!
Craig