Jump to content

Need to know how to do this function.


champbronc2

Recommended Posts

$JoinDate = ("SELECT joindate FROM `users` WHERE `username` = CONVERT( _utf8 '$customer' USING latin1 ) COLLATE latin1_swedish_ci");

$checkpemaile = mysql_query("SELECT * FROM users WHERE referer='' AND visits>=3*DateDiff ("d", NOW(), $JoinDate)");

$pemail_existe = mysql_num_rows($checkpemaile);

 

OK, So the problem is bolded.

 

It keeps saying that something is wrong with that. I am trying to make it do this: Multiply 3 by the difference of days between Now and the date a member joined.

 

Can anyone correct the script, and explain?

Link to comment
https://forums.phpfreaks.com/topic/125141-need-to-know-how-to-do-this-function/
Share on other sites

$checkpemaile = mysql_query("SELECT * FROM users WHERE referer='' AND visits>=3*DateDiff ("d", NOW(), $JoinDate)");

 

It seems that you have several problems.

I think this is the corrected version:

$checkpemaile = mysql_query("SELECT * FROM users WHERE referer=\"\" AND visits>=" . 3*DateDiff ("d", NOW(), $JoinDate));

If DateDiff() is a MYSQL function, then I'm probably wrong. If it's a PHP function, then I might be right, except I don't know what parameters it requires.

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.