Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Help in the date of last post in Threads

Asked Modified Viewed 3,127 times
P
PHPar
P
PHPar 10
  • Member, joined since
  • Contributed 118 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
asked
Member

I need help in calculating the date of the last post to today's date

like

If time is more than 360 days display the following code

bla bla bla

else {
echo "bla bla bla ";
}

help me with coding this
0 replies

5 posts

G
GMUDuckman
G
  • Senior Member, joined since
  • Contributed 266 posts on the community forums.
  • Started 6 threads in the forums
answered
Senior Member

Edited by GMUDuckman on 08-11-2010 05:05,
0 replies
P
PHPar
P
PHPar 10
  • Member, joined since
  • Contributed 118 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Member

i want this but not work where is the wrong

[syntaxhighlighter brush=plain,first-line=1,highlight=0,collapse=false,html-script=false]$result = dbquery(
"SELECT p.*
FROM ".DB_POSTS." p
WHERE p.thread_id='".$_GET['thread_id']."' ORDER BY post_datestamp "
);
$tt = time()-$data['post_datestamp'];
if (dbrows($result)){
if ($tt < 86400 ) {
echo "<td align='center' class='tbl2'><label>bla bla</label></td>\n";
}else{
echo "";
}
}[/syntaxhighlighter]
Edited by PHPar on 08-11-2010 07:34,
0 replies
G
GMUDuckman
G
  • Senior Member, joined since
  • Contributed 266 posts on the community forums.
  • Started 6 threads in the forums
answered
Senior Member

gotta have $data = dbarray($result) before you can use $data['post_datestamp']
Edited by GMUDuckman on 08-11-2010 16:09,
0 replies
P
PHPar
P
PHPar 10
  • Member, joined since
  • Contributed 118 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Member

hmm still not work
0 replies
G
GMUDuckman
G
  • Senior Member, joined since
  • Contributed 266 posts on the community forums.
  • Started 6 threads in the forums
answered
Senior Member

after $data = dbarray($result) and $tt = time()-$data['post_datestamp']; write this:

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]echo "$tt - ".time()." - ".$data['post_datestamp'];[/syntaxhighlighter]

you should have values for for all 3 variables, if not, this display should help you determine which variable is the troublesome one.
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 5 posts
  • Votes 0 votes
  • Topic users 2 members

2 participants

P
P
PHPar 10
  • Member, joined since
  • Contributed 118 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
G
G
  • Senior Member, joined since
  • Contributed 266 posts on the community forums.
  • Started 6 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet