Current location: Hot Scripts Forums » Programming Languages » PHP » PHP + MySQL script help need

PHP + MySQL script help need

Reply
  #1 (permalink)  
Old 09-07-03, 01:34 AM
andyinorbit2000 andyinorbit2000 is offline
Newbie Coder
 
Join Date: Sep 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Question PHP + MySQL script help need

I have a script that records hits into a MySQL db using:

PHP Code:
mysql_db_query($database"INSERT INTO sales VALUES ('$ref', '$clientdate', '$clienttime', '$clientbrowser', 
'$clientip', '$payment', '$clienturl')"

    or die(
"Database INSERT Error (line 34)"); 
However I need the script to check to see if the $ref value AND $clientdate value AND $clientip value are the same, if so dont store.

This way hits sent from the same reffer and using the IP address on the same day or not recorded in the db.

Any ideas?
If you would like to chat about this or would like any more info please email me at andyinorbit2000@yahoo.com


Thanks for any help you can give.
Andy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 09-09-03, 02:07 AM
SleeperZ SleeperZ is offline
Newbie Coder
 
Join Date: Jun 2003
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
$today = (todays date);

if (($ref == $clientip) && ($clientdate == $today))
{
//Do not store
}

else
{
//run sql query
}

Pretty basic example, but I am guessing that is what your asking?

/SleeperZ
__________________
***Expect the Unexpected***
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP script HELP Jerome PHP 7 12-22-09 06:44 AM
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
error when creating database tables with php script spiroth10 PHP 4 01-06-04 03:59 PM
PHP script required Mickey Job Offers & Assistance 8 09-07-03 03:00 PM
I need help with my first php script NeverMind PHP 4 08-01-03 01:27 PM


All times are GMT -5. The time now is 01:16 PM.
vBulletin® Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.