2 Values Put Into Database!!!

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Watch

PoorDoggie

Soon to be RICHdoggie!VIP Member
Impact
18
I have various scripts for my website, kinda like this one:
PHP:
// 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:
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
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains — AI StorefrontUnstoppable Domains — AI Storefront
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
 
0
•••
Try just putting LIMIT 1 into the query:
Code:
$sql = "INSERT INTO searchbar_referers (id, url, date) VALUES (NULL, '$sbr', NOW()) LIMIT 1";
 
0
•••
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! :o (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
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer
CatchedCatched

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com
Catchy
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back