![]() |
Help with query
I setup a $newmembers variable and I want it to display how many users have registered in the last 24 hours but I keep getting errors. Here is the code I am trying to use, any help would be great. :)
$newmembers=$DB_site->query_first("SELECT COUNT(*) AS count FROM user WHERE joindate>'".(time()-3600*24)."'); |
What's the error you are getting?
Two notes just off the top...you should be taking into account the TABLE_PREFIX, like shown below, and you don't need single quotes around an integer such as the joindate, so the query would look like: $newmembers = $DB_site->query_first("SELECT COUNT(*) AS count FROM ".TABLE_PREFIX."user WHERE joindate > ".(time()-3600*24)."); |
Quote:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/vhfansco/public_html/vb/modules/stats.php on line 32 What it's doing is giving me this parse error 2 lines past the line of code that I am adding for some reason. I should also mention this is for my stats module on my vbadvanced, still I set it up like all the others. |
Can you post the surrounding code? i.e. two lines above through about five lines below.
|
Sure, here's the entire module it's not too big. Hopefully it's okay to post this here, I will use the code tag.
Code:
<?php |
i got this worked out, the info is here if anyone is interested. I hate it when i dig for something and find a question and the reply is "nevermind I figured it out" when I need the answer lol. http://www.vbadvanced.com/forum/showthread.php?t=3988
|
Quote:
." shouldn't be there...oops... |
All times are GMT. The time now is 12:35 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|