Welcome Guest, Not a member yet? Register   Sign In
database structure - general
#5

[eluser]Jondolar[/eluser]
The proper way is to use a join in your query to join the post and the user tables. The post will contain the userid key. Your query would look something like this:

SELECT * FROM posts LEFT JOIN users ON posts.userid = users.userid WHERE postid = 1

Store the timestamp of the post in the database, then grab the current timestamp and subtract the post timestamp to get the difference in seconds. You can then divide by 60 to get the number of minutes.


Messages In This Thread
database structure - general - by El Forum - 06-26-2009, 10:50 AM
database structure - general - by El Forum - 06-26-2009, 10:56 AM
database structure - general - by El Forum - 06-26-2009, 11:10 AM
database structure - general - by El Forum - 06-26-2009, 11:54 AM
database structure - general - by El Forum - 06-26-2009, 02:56 PM
database structure - general - by El Forum - 06-26-2009, 04:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB