Jump to content

Help with Time?


lalnfl

Recommended Posts

Okay I have another question. Why isn't this SQL query working???

 

$sql_members_online = mysql_query("SELECT last_login_date FROM Member WHERE last_login_date BETWEEN '$time' AND '$current_time'");

 

 

the $time is the time with 10 minutes subtracting from the current time

 

and there is a last_login_date with datetime field, its just called last_login_date

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/214163-help-with-time/#findComment-1115405
Share on other sites

echo the query to make sure the variables are defined as you think they should be.  This is one reason to set the query in it's own variable.

 

$sql = "SELECT last_login_date FROM Member WHERE last_login_date BETWEEN '$time' AND '$current_time'";
$sql_members_online = mysql_query($sql) or die('Error: ' . $sql . '<br />' . mysql_error());

 

Link to comment
https://forums.phpfreaks.com/topic/214163-help-with-time/#findComment-1115408
Share on other sites

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.