Page 2 of 2

Re: what goes after the ? in links?

Posted: Fri Nov 06, 2009 2:31 pm
by craigwg
I GOT IT WORKING!!! It was in deed the apostrophies. Your code had apostrphies but the correct query goes like this:

Code: Select all

 
$query = "
  SELECT id, date_format(date, '%M %e, %Y') as date, title, entry 
  from tblJournal 
  WHERE id = $id 
  ORDER BY id DESC
  LIMIT $start, $display";
 
Notice the where statement has no apostrphies around neither the variable nor the field from the database. Now my permalinks are working! Which means now my RSS feed is more accurate! We are excited about this!!!!!!!!!!

Now I just need to deal with more apostrophies in the actual text of my journal interfering with the RSS feed. Then I think I'm going to attach it to my facebook page, and maybe just maybe, reformat the page so it doesn't look like it came from the 1980s!

Thanks again!

Re: what goes after the ? in links?

Posted: Fri Nov 06, 2009 3:34 pm
by craigwg
Oysh,

Yes I did the the ?id=x working. But on further review, it broke everything else.

For example, once I used ?id=x it set the id variable. So when I went to use the pagination on the page, or simply use a link on my nav bar that does NOT use the id variable it panicked.

I tried a few fixes, none with success. I attempted setting the id variable to NULL at the end of the document but that didn't work. I also attempted adjusting the query to display the max ID. Maybe that's the answer - to redo all the links on my site and across the web. I still want to be able to give people my regular webpage as http://www.craiggreenwood.com/journal.php and have it display the most recent entry.

Ug, I'm not even sure what question to ask. What is the standard way of doing this? Everyone has permalinks and my desire isn't anything beyond that.

Craig

Re: what goes after the ? in links?

Posted: Fri Nov 06, 2009 9:05 pm
by Eric!
As I mentioned before you need to add error checking for missing values and out of range values.

If the id is not set, maybe you should use your original query string without the where id='$id'. It's up to you how you want your site to respond.

You also need error checking for 's' and 'ns' as well as adding filtering I suggested in my previous post.