Jump to content

[SOLVED] strtotime in a query?


almightyegg

Recommended Posts

I have this code

if($gauge == TRUE){
$timestamp = date("Y-m-d H:i:s");
$d2 = strtotime($timestamp);
$info .= " and strtotime(`gauge`) > '$d2'";
}

 

$info becomes this big long string and is like this:

$info = "SELECT * FROM users WHERE$info";
$sel = mysql_query("$info") or die(mysql_error());

 

Problem is, I'm not sure how to do the strtotime() to the table variable. it's reading it a a column heading:

FUNCTION lordofth_game.strtotime does not exist

 

Any help on how to get it to work would be greatly received

Link to comment
https://forums.phpfreaks.com/topic/154015-solved-strtotime-in-a-query/
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.