Hi, long time no see ... I have been really busy the last while, don't even have time to breathe properly.
Anyhow, I don't quite understand MySql rollbacks properly, so here is my question:
I have something like the following:
include_once("class.data.php");
include_once("class.something.php");
//the 'something' class extends the 'data' class.
$something = New Something();
$something->create("data");
$something->create("something");
- include_once("class.data.php");
- include_once("class.something.php");
- //the 'something' class extends the 'data' class.
- $something = New Something();
- $something->create("data");
- $something->create("something");
when running the '$something->create()' method it runs two seperate MySql queries one inserts into the 'data' table and the other into the 'something' table. These queries are automatically created by 'EXPLAIN'ing the table I pass as the paramenter.
I was then trying something as follows:
include_once("class.data.php");
include_once("class.something.php");
//the 'something' class extends the 'data' class.
$temp = mysql_query("START TRANSACTION");
$something = New Something();
$something->create("data");
$something->create("something");
$temp = mysql_query("ROLLBACK");
- include_once("class.data.php");
- include_once("class.something.php");
- //the 'something' class extends the 'data' class.
- $temp = mysql_query("START TRANSACTION");
- $something = New Something();
- $something->create("data");
- $something->create("something");
- $temp = mysql_query("ROLLBACK");
but it didn't do anything, both rows still inserted into the database. What exactly is the issue here?
Let's leave all our *plum* where it is and go live in the jungle ...