Jump to content

[SOLVED] Best way to do this?


LooieENG

Recommended Posts

For each blog post, I dunno whether to echo

<a href="index.php?u=ID">user</a>

or

<a href="index.php?u=user">user</a>

 

I'd prefer ?u=ID, but then for each blog post would I have to perform a MySQL query to get the name of the user who posted it, or is there another way?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/112094-solved-best-way-to-do-this/
Share on other sites

Surely anyway wouldn't you need to call the body of the blog post, title of the blog post, etc..?

If I was doing the same thing, I would also have an author field in the same table. In which case, it wouldn't be that difficult to add an extra line or so to get the author from the database.

 

But ID's are the best way to retrieve hierarchical data, or any kind of data to be honest.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.