Help!!!

From: Date: Thu, 23 Jan 2003 13:45:36 +0000
Subject: Help!!!
Groups: php.general 
Request: Send a blank email to php-general+get-132824@lists.php.net to get a copy of this message
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

« previous php.general (#132824) next »