Re: Help!!!

From: Date: Thu, 23 Jan 2003 13:52:15 +0000
Subject: Re: Help!!!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-132827@lists.php.net to get a copy of this message
ok i think i see the problem but how do i fix? Before call to procedure: VARS: 1,1,213.123.253.117, inside procedure: VARS: ,,, Causing: connectin: insert into referral (RID, RGID, VisitorIP, VisitorDate, VisitorFromURL) values(Resource id #4,Resource id #4,'Resource id #4',NOW(),'Resource id #4') inserted not Sorry, an error has occured. It has been recorded and reported to the Website Administrator. Error: SQL: Error Code: 1065: Query was empty "Brian McGarvie" <brian.mcgarvie@anypurposeloans.co.uk> wrote in message news:20030123134546.15347.qmail@pb1.pair.com... > I have just got use of a new dedicated webserver... > > Now the 1st time a piece of code is ran it doesnt work but then the 2nd it > does... > > i.e. > > index.php > > // stuff... > $visitDBID = referrerVisit($rid,$rgid,$visitIP,$visitFromURL); > // stuff... > > //end index.php > > function referrerVisit($rid,$rgid,$visitIP,$visitFromURL) { > $db = dbConnect(); > $sql = " > insert into referral > (RID, RGID, VisitorIP, VisitorDate, VisitorFromURL) > values($rid,$rgid,'$visitIP',NOW(),'$visitFromURL') > "; > echo $sql; > $result=mysql_query($sql); > if(mysql_error()) { > echo "inserted not"; > $errormessage = ""; > $errormessage .= "SQL: $sql<br>"; > $errormessage .= "Error Code: ".mysql_errno().": ".mysql_error(); > echo " > Sorry, an error has occured. It has been recorded and reported > to the Website Administrator.<br><br> > Error:<br> > $errormessage > "; > return null; > } else { > echo "inserted"; > return mysql_insert_id($db); > } > } > > When it's ran initilly: the sql that i generated looks like: > > insert into referral (RID, RGID, VisitorIP, VisitorDate, VisitorFromURL) > values( insert into referral (RID, RGID, VisitorIP, VisitorDate, > VisitorFromURL) values(Resource id #4,Resource id #4,'Resource id > #4',NOW(),'Resource id #4') , insert into referral (RID, RGID, VisitorIP, > VisitorDate, VisitorFromURL) values(Resource id #4,Resource id #4,'Resource > id #4',NOW(),'Resource id #4') ,' > > and gives the error: > > Error: > SQL: > Error Code: 1065: Query was empty > > However if i refresh the page: it executes correctly... > > Any ideas? > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.438 / Virus Database: 246 - Release Date: 07/01/03 > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.438 / Virus Database: 246 - Release Date: 07/01/03

« previous php.general (#132827) next »