http://www.phpbuilder.com/columns/besserer20050729.php3?aid=952 This made a lot of sense to me but one part He queries the database for $query = "SELECT `title` , `entry` , `date_entered` , `user` FROM blog ORDER BY date_entered DESC"; PHP: Then however I never seem him define 'entry' as a variable $date_entered = date ('F j g:i A', $row['date_entered']); //The time data is being formated for a proper display to the page $user = $row['user']; $title = $row['title']; $entry = nl2br ($entry); PHP: What am I missing here?
I think SoKickIt is correct here, probably just a mistake. Sadly you see it quite often. Writers tend to cover material they are comfortable with and comfort breeds complacency. They don't always test their code. There are actually a whole bunch of typos in the article, from what I've read so far just shy of 1 per paragraph.
well since everyone has been so helpful i was wondering if you can explain to me what /n is and when a variable = " " like the following function getHeader($own, $total, $Itemid){ $return = ''; PHP:
Debugging your code should not be something you forget. I've written articles in the past and had readers identify errors but they've all been errors which didn't affect the actual function of the code. I haven't run the script in the article here but I suspect the error would stop it from working. I think your /n should actually be \n, it's a newline character. Various reasons why your might set a variable to no value, if you have a loop you might want to ensure a variable is empty before writing to it. NOt the only reason but the first which springs to mind.