• Welcome to The Cave of Dragonflies forums, where the smallest bugs live alongside the strongest dragons.

    Guests are not able to post messages or even read certain areas of the forums. Now, that's boring, don't you think? Registration, on the other hand, is simple, completely free of charge, and does not require you to give out any personal information at all. As soon as you register, you can take part in some of the happy fun things at the forums such as posting messages, voting in polls, sending private messages to people and being told that this is where we drink tea and eat cod.

    Of course I'm not forcing you to do anything if you don't want to, but seriously, what have you got to lose? Five seconds of your life?

PHP Link Update

Lorem Ipsum

Member
Pronoun
x
Basically, I've developed my own blog script for use on the site that I help maintain, and every time I write a post, the MySQL postid number increments, and that's how you access the post (blog.php?id=1, etc). The only problem with this is that I have to manually update the links to each individual post at the top of the page, which can be irritating.

Is there any way to have this be done automatically when I make a post? I presume it would be something like through a loop, but I'm not entirely sure how that would work. Any help would be much appreciated!

ETA: And another problem - when I have the front page of the blog (click) it shows the most recent blog entry. Unfortunately, when one uses the comments system there, it posts with the blog id number as "0" and so doesn't sort the comment to the specific blog post. Is there any way for somebody to comment on that frontpage blog entry and for it to go to its specific blog entry link?
 
Last edited:

Butterfree

Still loves Joltik, though!
Staff member
Pronoun
she/her
Why on earth are you having the ID for each blog post change? o_O The one with ID 1 should be remaining the one with ID 1; new ones should have increasing IDs. The other way is monstrously impractical in every possible sense; I cannot fathom why you would do it that way.
 

Lorem Ipsum

Member
Pronoun
x
That's what happens already, if I understand what you mean:

The first blog post was blog.php?id=1
The second was blog.php?id=2

What I'm trying to say is that at the top of the blog section of the site, there are a series of links corresponding to each individual article, and when one clicks on them, it takes you to that specific article. At the moment, when I write a new article, that menu doesn't update to include the link to the new blog post - I have to do it manually.
 

Butterfree

Still loves Joltik, though!
Staff member
Pronoun
she/her
Yeah, run a database query like SELECT id, title FROM blog ORDER BY timestamp DESC and have a loop generate the links from the results.

Also, for the other problem, fetch the blog ID from the database along with the actual entry and insert that as a hidden field into the comment form.
 
Top