[advanced search]
Results from the most recent live auction are here.
22 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Domain Name Industry Newsletter
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 06-03-2006, 12:01 PM   · #1
PoorDoggie
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
 
Name: Tom
Location: UK
Trader Rating: (36)
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (Donate)
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
2 Values Put Into Database!!!!

I have various scripts for my website, kinda like this one:
PHP Code:
// get a search_bar referer if there is one...
if(isset($_GET['sbr'])){
  
$dbc = mysql_connect("localhost", "blah", "blah");
  
mysql_select_db("blah",$dbc);
  
  
$sbr = addslashes(urldecode($_GET['sbr']));
  
  
$sql = "INSERT INTO searchbar_referers (id, url, date) VALUES (NULL, '$sbr', NOW())";
  
$result = mysql_query($sql);
  if(!
$result){
    echo
"something wrong";
  }
}

It all works, but it seems to be putting 2 copies into the database! argh!!!

eg:
Quote:
Edit Delete | 2 referrerurl.com 2006-06-03
Edit Delete | 3 referrerurl.com 2006-06-03



It does this with another of my scripts as well. Is it something to do with the way I am coding?

Thanks for your help
Tom


Please register or log-in into NamePros to hide ads
PoorDoggie is offline   Reply With Quote
Old 06-03-2006, 02:58 PM   · #2
iNod
Eating Pie
 
iNod's Avatar
 
Name: Steve
Location: Canada
Trader Rating: (66)
Join Date: Nov 2004
Posts: 2,284
NP$: 91.30 (Donate)
iNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud of
Special Olympics AIDS/HIV Cystic Fibrosis Save The Children Baby Health Cystic Fibrosis
You know what.. My scripts do the same thing.. The only thing the same with us.. Is we are both hosted by PolurNet.. Atleast I think you do.

Hrm.. I think we need to chekc this out.

- Steve
__________________
RegisterDub.com - 200th Customer Milestone
ZuneParts.net - International Zune Parts and Accessories
FeaturedFont.com - One Top Free Font a Day!
iNod is offline   Reply With Quote
Old 06-03-2006, 03:52 PM   · #3
Shorty
Senior Member
 
Shorty's Avatar
 
Name: Thomas White
Location: England
Trader Rating: (15)
Join Date: Sep 2005
Posts: 1,033
NP$: 31.15 (Donate)
Shorty is just really niceShorty is just really niceShorty is just really niceShorty is just really nice
Try just putting LIMIT 1 into the query:
Code:
$sql = "INSERT INTO searchbar_referers (id, url, date) VALUES (NULL, '$sbr', NOW()) LIMIT 1";
Shorty is offline   Reply With Quote
Old 06-03-2006, 04:58 PM   · #4
PoorDoggie
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
 
Name: Tom
Location: UK
Trader Rating: (36)
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (Donate)
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
nope - hostgator.com, but you could be right in one respect, because the IP that runs the script a second time is always the same! (dum dum duuuummm). So it could be something to do with the hosting. Maybe polurnet uses a program that hostgator does? Anywho... shorty I will try out your suggestion thanks
PoorDoggie is offline   Reply With Quote
Closed Thread

NamePros is a revenue sharing forum.

Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
Buy Flash Arcade Game Script RealTechNetwork Website Header Design
Advertise your business at NamePros
All times are GMT -7. The time now is 09:30 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0