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? Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.