UPDATE table SET click = click + 1 WHERE month = MONTH(NOW()) AND year =
YEAR(NOW()) AND id = 775

Don't need to use PHP at all...

---John Holmes...

> -----Original Message-----
> From: r [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, June 01, 2002 6:13 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Affiliate PHP program project - Please help
> 
> Hi PPL,
> 
> I'm doing an affiliate program for a small company in PHP, but am
stuck a
> bit in the logic or thinking process....
> 
> I have a table with IdNo,clicks,month,year
> 
> the affiliates will get a link like this
> http://mysite.com/affiliates/aff.php?IdNo=775
> 
> every time I get a click from 775 in the table I am updating the table
> with
> something like clicks=clicks+1 where month=6 and year=2002 and
IdNo=775
> 
> My question is how do I get the current month/year from php or do I
have
> to
> query the database before every update to get month() and month(day)?
> 
> will I have to use something like
> (for month) $mon=date(m);
> (for year ) $yer=date(Y);
> 
> plus the main reason I am writing is to ask you gurus if I have the
right
> idea to make this work or is it done in some other way? Maybe you have
> done
> a similar program and and can give me some valuble info/insight or
wise
> words? ;-)
> 
> OT- do you have any idea on how to contral the cursor in a form with
10
> textfields? is it possible without javascript?
> 
> Thanks in advance for ANY help on this,
> Have a great day,
> -Ryan.
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to