Re: Help: Transactions not working

From: Date: Fri, 15 Oct 2004 11:07:21 +0000
Subject: Re: Help: Transactions not working
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-36818@lists.php.net to get a copy of this message
Stuart Felenstein wrote:
If you see the code I have the begin , then the $query follows. With both statements present, only the second one does the insert. If I // or remove the second, the first one takes. Am I missing something here ?
Yep... you're missing a mysql_query() call for each query. You're only running one query and echoing the other...
$query = "INSERT INTO Profiles (ProfileID, UserID, ProfileName, Edu, WorkAuth, WorkExp, CarLev, Secu, Confi, Relo, Telecomu, City1, State1, City2, State2, TravelPref, SalaryAnnual, SalaryHourly, Available) VALUES (null, null, '$f1a', $f2a, $f2c, $f2d, $f2e, $f2g, '$f5b', '$f3m', '$f3n', '$f3e', $f3f, '$f3g', $f3h, $f3i, $f3j, $f3k, $f3l)"; echo $query;
$result = mysql_query($query);
$query = "INSERT INTO LurkProfiles_AddContacts (AddContID, ProfileID, P1, P2, Pgr, Eml2, Eml3) VALUES (null, LAST_INSERT_ID(), '$f1b', '$f1c', '$f1d', '$f1e', '$f1g')"; echo $query; $result = mysql_query($query);
-- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.db (#36818) next »