[PHP-DB] PHP Processing
I'm sorry, I feel dense coming to the list for this, because I'm SURE I've read about this in the PHP or Mysql docs, but I can't seem to locate where. Let's say users submit a form which is processed by a PHP page which performs a number of MySQL INSERT, UPDATE, and/or DELETE commands. . What happens if the user hits Stop or Refresh in their browser before the transaction is complete - is there a possibility that only some of the MySQL commands will complete? Not a problem if the services are all running well, but I'm thinking if things are getting thrashed on the server for whatever reason, it might take several seconds to complete the various SQL commands, also increasing the likelihood of the user getting bored enough to start playing bull in a browser shop. And since MySQL has no rollback feature that I'm aware of, how would you best handle this dangerous potentiality? Suggestions? A humble request: Responses which begin with: Don't use MySQL, please include a good affordable alternative? -P Peter Westergaard [EMAIL PROTECTED] ### ICQ#: 10294457 http://www.westergaard.ca/ ### http://courtly.livejournal.com -- 'Alright, you guys start coding. I'll go find out what the customer wants.' === EASY and FREE access to your email anywhere: http://Mailreader.com/ === -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] PHP Processing
I believe the PHP parser will completely process that page whether you click stop or not. In my experience it's always been all or nothing as long as you don't hit an error half way through which I'd imagine could cause a problem. Ryan -Original Message- From: Peter Westergaard [mailto:[EMAIL PROTECTED] Sent: Monday, January 05, 2004 3:14 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] PHP Processing I'm sorry, I feel dense coming to the list for this, because I'm SURE I've read about this in the PHP or Mysql docs, but I can't seem to locate where. Let's say users submit a form which is processed by a PHP page which performs a number of MySQL INSERT, UPDATE, and/or DELETE commands. . What happens if the user hits Stop or Refresh in their browser before the transaction is complete - is there a possibility that only some of the MySQL commands will complete? Not a problem if the services are all running well, but I'm thinking if things are getting thrashed on the server for whatever reason, it might take several seconds to complete the various SQL commands, also increasing the likelihood of the user getting bored enough to start playing bull in a browser shop. And since MySQL has no rollback feature that I'm aware of, how would you best handle this dangerous potentiality? Suggestions? A humble request: Responses which begin with: Don't use MySQL, please include a good affordable alternative? -P Peter Westergaard [EMAIL PROTECTED] ### ICQ#: 10294457 http://www.westergaard.ca/ ### http://courtly.livejournal.com -- 'Alright, you guys start coding. I'll go find out what the customer wants.' === EASY and FREE access to your email anywhere: http://Mailreader.com/ === -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP Processing
Do a search for user stop in the PHP manual, there you will find connection handling and the ignore_user_abort function. At 2004/01/05 17:14, Peter Westergaard wrote: I'm sorry, I feel dense coming to the list for this, because I'm SURE I've read about this in the PHP or Mysql docs, but I can't seem to locate where. Let's say users submit a form which is processed by a PHP page which performs a number of MySQL INSERT, UPDATE, and/or DELETE commands. . What happens if the user hits Stop or Refresh in their browser before the transaction is complete - is there a possibility that only some of the MySQL commands will complete? Not a problem if the services are all running well, but I'm thinking if things are getting thrashed on the server for whatever reason, it might take several seconds to complete the various SQL commands, also increasing the likelihood of the user getting bored enough to start playing bull in a browser shop. And since MySQL has no rollback feature that I'm aware of, how would you best handle this dangerous potentiality? Suggestions? A humble request: Responses which begin with: Don't use MySQL, please include a good affordable alternative? -P Peter Westergaard [EMAIL PROTECTED] ### ICQ#: 10294457 http://www.westergaard.ca/ ### http://courtly.livejournal.com -- 'Alright, you guys start coding. I'll go find out what the customer wants.' === EASY and FREE access to your email anywhere: http://Mailreader.com/ === -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] PHP Processing
It appears that execution does stop if there is any output to the browser. I usually do all of my query work before sending output to the browser which would explain why I haven't seen it fail to complete. I think this is what happens: mysql_db_query(blaaa); These three should happen regardless. mysql_db_query(blaaa); mysql_db_query(blaaa); echo blaaa; -- This point could stop if user has hit stop when it gets there. mysql_db)query(blaaa); Anyone know different? Anyway, ignore_user_abort(true); seems to do the trick. Ryan -Original Message- From: Alan Langford [mailto:[EMAIL PROTECTED] Sent: Monday, January 05, 2004 3:48 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP-DB] PHP Processing Do a search for user stop in the PHP manual, there you will find connection handling and the ignore_user_abort function. At 2004/01/05 17:14, Peter Westergaard wrote: I'm sorry, I feel dense coming to the list for this, because I'm SURE I've read about this in the PHP or Mysql docs, but I can't seem to locate where. Let's say users submit a form which is processed by a PHP page which performs a number of MySQL INSERT, UPDATE, and/or DELETE commands. . What happens if the user hits Stop or Refresh in their browser before the transaction is complete - is there a possibility that only some of the MySQL commands will complete? Not a problem if the services are all running well, but I'm thinking if things are getting thrashed on the server for whatever reason, it might take several seconds to complete the various SQL commands, also increasing the likelihood of the user getting bored enough to start playing bull in a browser shop. And since MySQL has no rollback feature that I'm aware of, how would you best handle this dangerous potentiality? Suggestions? A humble request: Responses which begin with: Don't use MySQL, please include a good affordable alternative? -P Peter Westergaard [EMAIL PROTECTED] ### ICQ#: 10294457 http://www.westergaard.ca/ ### http://courtly.livejournal.com -- 'Alright, you guys start coding. I'll go find out what the customer wants.' === EASY and FREE access to your email anywhere: http://Mailreader.com/ === -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP Processing
You can always test if your SQL statement successfully completed or not to determine errors. Using: $myresult =mysql_query($queryX,$myconn); if (! $myresult) { echo mysql_error($myresult) ; } else { // nothing or echo Query successful; } Ryan Jameson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I believe the PHP parser will completely process that page whether you click stop or not. In my experience it's always been all or nothing as long as you don't hit an error half way through which I'd imagine could cause a problem. Ryan -Original Message- From: Peter Westergaard [mailto:[EMAIL PROTECTED] Sent: Monday, January 05, 2004 3:14 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] PHP Processing I'm sorry, I feel dense coming to the list for this, because I'm SURE I've read about this in the PHP or Mysql docs, but I can't seem to locate where. Let's say users submit a form which is processed by a PHP page which performs a number of MySQL INSERT, UPDATE, and/or DELETE commands. . What happens if the user hits Stop or Refresh in their browser before the transaction is complete - is there a possibility that only some of the MySQL commands will complete? Not a problem if the services are all running well, but I'm thinking if things are getting thrashed on the server for whatever reason, it might take several seconds to complete the various SQL commands, also increasing the likelihood of the user getting bored enough to start playing bull in a browser shop. And since MySQL has no rollback feature that I'm aware of, how would you best handle this dangerous potentiality? Suggestions? A humble request: Responses which begin with: Don't use MySQL, please include a good affordable alternative? -P Peter Westergaard [EMAIL PROTECTED] ### ICQ#: 10294457 http://www.westergaard.ca/ ### http://courtly.livejournal.com -- 'Alright, you guys start coding. I'll go find out what the customer wants.' === EASY and FREE access to your email anywhere: http://Mailreader.com/ === -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP Processing
We use the Access-Engine via ODBC. And it sopports rollbacks. But, please, how could I rollback, what I want to, when I use a p-connection. For example: Transaction 1 (UPDATE TAB1...); Transaction 2 (UPDATE TAB2...); Between Transaction1 and Transaction2 the Connection to the DB gets interrupted (ig power failure). When the machine is startred again, the programm should go back to the last rollbackpoint. But how can I tell the programm what he should rollback? THX. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP Processing
ALL OR NOTHING: (works i.e. with MS ACCESS - ODBC) function prepare() { global $conn; $result = odbc_prepare ( $conn, CREATE TABLE XX(test int);CRATE TABLE YY;); if(odbc_execute($result)){echo Everything is OK (but shouldn't!).;} else{echo Error in the statement. Table XX should NOT be there.;} } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php