Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 31, 2026.

2 Values Put Into Database!!!

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
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.
GoDaddyGoDaddy
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
•••
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

New in Parking: updated way to act on many domains or inquiries at once
Your domain list and inquiry list now have a bar above and below the list. Check the items you want, then choose an action in the bar...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back