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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.