Results from the most recent live auction are here .
22 members in the live chat room. Join Chat !
06-03-2006, 12:01 PM
· #1 Soon to be RICHdoggie!
Name: Tom
Location: UK
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (
Donate )
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
06-03-2006, 02:58 PM
· #2 Eating Pie
Name: Steve
Location: Canada
Join Date: Nov 2004
Posts: 2,284
NP$: 91.30 (
Donate )
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
06-03-2006, 03:52 PM
· #3 Senior Member
Name: Thomas White
Location: England
Join Date: Sep 2005
Posts: 1,033
NP$: 31.15 (
Donate )
Try just putting LIMIT 1 into the query:
Code:
$sql = "INSERT INTO searchbar_referers (id, url, date) VALUES (NULL, '$sbr', NOW()) LIMIT 1";
06-03-2006, 04:58 PM
· #4 Soon to be RICHdoggie!
Name: Tom
Location: UK
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (
Donate )
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
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off