Tagged Questions
4
votes
4answers
17k views
How can I implement commit/rollback for MySQL in PHP?
Well basically I have this script that takes a long time to execute and occasionally times out and leaves semi-complete data floating around my database. (Yes I know in a perfect world I would fix ...
3
votes
1answer
2k views
mysql commit and transaction
I have a question regarding mysql commits and transactions.
I have a couple of php statements that execute mysql queries.
Do I just say the following?
mysql_query("START TRANSACTION");
//more ...
2
votes
2answers
410 views
Trouble using MySQL transactions with loops in PHP
I am trying to set up a MySQL transaction such that I can loop through a bunch of queries (see below) and if any of them fail, rollback all of the changes. I am finding however that if one fails, not ...
2
votes
2answers
811 views
PHP: How can I check for errors during a mysqli commit?
I am inserting a lot of records using mysqli commit statement, using this code from http://www.php.net/manual/en/mysqli.commit.php#88857. I then check affected rows using:
$mysqli->affected_rows
but ...
1
vote
2answers
5k views
PHP & mySQL: Simple code to implement Transaction - Commit & Rollback
MY PLATFORM:
PHP & mySQL
MY SITUATION:
I am trying to implement transactions within my code. I tried to follow examples, but it's not much help. I am running 3 queries and I wanted to write a ...
1
vote
4answers
107 views
PHP: my page takes a very long time to load but does not time out. Are there too many queries at once or can my code be optimized?
This is the function I use to access the DB, theoretically maybe up 10-20 times in a do while loop, though right now I removed the loop so it only can do one db query at a time. Can this be optimized ...
1
vote
1answer
114 views
Does mysql_query commit everything
I am using mysql extension in php, I know it is deprecated as of PHP 5.5.0, but I have a lot of code allready written with the use of this extension.
It seems to me like mysql_query commits the query, ...
1
vote
3answers
209 views
MySQL Transaction+ PHP issue in Mysql
I have a code which was used in an application where I am having a problem in rollback. Even if I 's2' returns false rollback isn't happening i.e. table 'products' is getting droped.
Can anyone ...
1
vote
2answers
348 views
php exec(svn commit) hangs
I know there's been similar questions but they don't solve my problem...
After checking out the folders from the repo (which works fine).
A method is called from jquery to execute the following in ...
1
vote
1answer
63 views
PHP, Subversion, and Cloning then Committing a Directory Structure
I have an interesting problem that I am hoping somebody might be able to help me solve. I have a subversion repository which I use to store the source code for a very large PHP site. Here are some ...
1
vote
1answer
233 views
Does commit or rollback turn autocommit on impliclitly in PHP's mysqli?
I'm doing transactions in PHP with the mysqli class and I find the documentation of autocommit() woefully incomplete.
I infer from the examples that setting autocommit to false implicitly performs a ...
0
votes
1answer
170 views
Multiple insertion in mysql tables
i am facing a problem in inserting into mysql tables. I have 3 related tables to insert on save, but I want to make sure that either all of the queries are run, or none of them. I have done this in ...
0
votes
3answers
290 views
will mysqli->rollback(), rollback every query that has been previously committed?
I want to know if mysqli->rollback will rollback all the queries that have been committed before the rollback.
For example, in the code below, the first query will be committed, but the second query ...
0
votes
0answers
25 views
PHP + ORACLE - Managing transactions
I have script1.php and its code looks like below
$con = oci_pconnect(connection_details);
if(!$con){
//throw error;
}
$q1 = "SOME INSERT STATEMENT on EMPLOYEE TABLE";
$stid = oci_parse($con, $q1);
...
0
votes
1answer
19 views
Please help me understanding MySQL InnoDB Transactions
I'm trying to understand the locking mechanisms for InnoDB.
Let's say i have the following PHP script:
mysql_query('BEGIN;');
$a=mysql_query('SELECT id, status FROM testtable WHERE id=123 LIMIT 1 ...