TheFilmGod Posted January 15, 2011 Share Posted January 15, 2011 I am ripping my hair out because I've been trying to resolve this issue for the past 2 hours now and I have not made an progress. Basically, I have a transaction that inserts a record and updates another table. I commit the transaction. Then, php does some work and issues a SELECT statement. The select statement fails. At first I had to no idea why. Without the transaction it was working fine..? So I'm thinking maybe the transaction is locking the table for too long and causing the query to fail? I don't know. Looking for any advice help or pointers. I'm at the point of throwing my hands up and giving up. It doesn't make any sense. Quote Link to comment https://forums.phpfreaks.com/topic/224491-transaction-commits-but-then-select-statement-fails/ Share on other sites More sharing options...
TheFilmGod Posted January 15, 2011 Author Share Posted January 15, 2011 Error: 2014 commands out of sync. HUH? Quote Link to comment https://forums.phpfreaks.com/topic/224491-transaction-commits-but-then-select-statement-fails/#findComment-1159649 Share on other sites More sharing options...
Muddy_Funster Posted January 16, 2011 Share Posted January 16, 2011 any chance of some code to work with? Quote Link to comment https://forums.phpfreaks.com/topic/224491-transaction-commits-but-then-select-statement-fails/#findComment-1160329 Share on other sites More sharing options...
fenway Posted January 19, 2011 Share Posted January 19, 2011 Yeah, we can't guess what you're telling the server to do. Quote Link to comment https://forums.phpfreaks.com/topic/224491-transaction-commits-but-then-select-statement-fails/#findComment-1162141 Share on other sites More sharing options...
mikosiko Posted January 19, 2011 Share Posted January 19, 2011 agree with Fenway and Muddy... post your code to get better help... just guessing.... to execute your Transaction are you using an Stored Procedure or Function?... something like: <?php $query = "CALL your_procedure()"; mysql_query($query); .... .... $query2 = "SELECT a,b,s .... "; mysql_query($query2); // The error could be triggered here depending on what you did // before this query with the results of the previous one ?> if is something like this what are you doing then the error is caused because you are no processing all the results produced by the SP (at least 2). Quote Link to comment https://forums.phpfreaks.com/topic/224491-transaction-commits-but-then-select-statement-fails/#findComment-1162162 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.