champbronc2 Posted September 21, 2008 Share Posted September 21, 2008 $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 More sharing options...
redarrow Posted September 21, 2008 Share Posted September 21, 2008 look at interval http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_datediff Link to comment https://forums.phpfreaks.com/topic/125141-need-to-know-how-to-do-this-function/#findComment-646806 Share on other sites More sharing options...
champbronc2 Posted September 21, 2008 Author Share Posted September 21, 2008 I did. I can't find any information on multiplication. Any help? Link to comment https://forums.phpfreaks.com/topic/125141-need-to-know-how-to-do-this-function/#findComment-647237 Share on other sites More sharing options...
FIREBALL5 Posted September 22, 2008 Share Posted September 22, 2008 $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. Link to comment https://forums.phpfreaks.com/topic/125141-need-to-know-how-to-do-this-function/#findComment-647324 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.