PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
hello,
i am not shure if this is a correct place to ask this, if not, pls excuse me, and move it to the propper place.
pls explain what committing means and perhaps give me an example
I have no ideea what this means in english in regard with programming and I found it in the php manual.
Ex
When used in transactions, mysql_insert_id() MUST be called before committing.
Thx
Last edited by Think Pink on Sat May 12, 2007 2:23 pm, edited 1 time in total.
It means - if you're combining a load of MySQL commands together as a transaction, you call "committ" to say "save those commands" (write the data). So ...
INSERT INTO abc VALUES (1,2,3);
INSERT INTO abc VALUES (3,4,5);
INSERT INTO abc VALUES (11,22,33);
INSERT INTO abc VALUES (111,222,333);
COMMIT;
(That's not actual code - just to give the idea!).
If you wanted to call mysql_insert_id to get the last ID inserted you should put this *before* you commit the transaction... thus ...
INSERT INTO abc VALUES (1,2,3);
INSERT INTO abc VALUES (3,4,5);
INSERT INTO abc VALUES (11,22,33);
INSERT INTO abc VALUES (111,222,333);
...
$id = mysql_insert_id($dbhandler);
...
COMMIT;