Bug #17049 Updated: mysql_insert_id not working
ID: 17049 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Feedback Bug Type: MySQL related Operating System: FreeBSD PHP Version: 4.1.2 New Comment: Also see Bug #17343. We pinned it down and general reasoning for why it's happening as well as a work around. -Szii Previous Comments: [2002-05-06 18:40:28] [EMAIL PROTECTED] To further clarify... I'm not sure what version I was running on my development server before 4.0.6. I do know I've been using version 4 for a long while but I do not recall specifically. sorry. [2002-05-06 18:37:38] [EMAIL PROTECTED] The server running 4.0.6 on linux is my development server . I upgraded that in response to the file upload security issue. The server running 4.1.2 is my production server and they do upgrades on their own timetable. They were previously running a version slighly older than 4.0.6. I have now included the db link as a parameter in all instances of mysql_insert_id and everything is back to working fine. [2002-05-06 16:19:54] [EMAIL PROTECTED] First you said, you have the problem with 4.1.2 (as stated in this report Version: field) and the same problem with 4.0.6 . So which version did worked for you and from which version did you upgrade to 4.1.2 where it broke? [2002-05-06 16:11:31] [EMAIL PROTECTED] Several scripts broke on two different servers when a php upgrade was made. The db query is an insert and the mysql_insert_id now requires a parameter to work properly whereas before it did not. [2002-05-06 16:03:46] [EMAIL PROTECTED] sorry. I meant mysql_insert_id The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/17049 -- Edit this bug report at http://bugs.php.net/?id=17049&edit=1
Bug #17049 Updated: mysql_insert_id not working
ID: 17049 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Feedback Bug Type: MySQL related Operating System: FreeBSD PHP Version: 4.1.2 New Comment: To further clarify... I'm not sure what version I was running on my development server before 4.0.6. I do know I've been using version 4 for a long while but I do not recall specifically. sorry. Previous Comments: [2002-05-06 18:37:38] [EMAIL PROTECTED] The server running 4.0.6 on linux is my development server . I upgraded that in response to the file upload security issue. The server running 4.1.2 is my production server and they do upgrades on their own timetable. They were previously running a version slighly older than 4.0.6. I have now included the db link as a parameter in all instances of mysql_insert_id and everything is back to working fine. [2002-05-06 16:19:54] [EMAIL PROTECTED] First you said, you have the problem with 4.1.2 (as stated in this report Version: field) and the same problem with 4.0.6 . So which version did worked for you and from which version did you upgrade to 4.1.2 where it broke? [2002-05-06 16:11:31] [EMAIL PROTECTED] Several scripts broke on two different servers when a php upgrade was made. The db query is an insert and the mysql_insert_id now requires a parameter to work properly whereas before it did not. [2002-05-06 16:03:46] [EMAIL PROTECTED] sorry. I meant mysql_insert_id [2002-05-06 15:49:12] [EMAIL PROTECTED] mysql_insert_id() only returns something if: -the most recent query was an INSERT query -AND you're using a AUTO_INCREMENT (and thus PRIMARY KEY) field in the table you're inserting data to. If that's not the case, mysql_insert_id() will return 0. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/17049 -- Edit this bug report at http://bugs.php.net/?id=17049&edit=1
Bug #17049 Updated: mysql_insert_id not working
ID: 17049 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Feedback Bug Type: MySQL related Operating System: FreeBSD PHP Version: 4.1.2 New Comment: The server running 4.0.6 on linux is my development server . I upgraded that in response to the file upload security issue. The server running 4.1.2 is my production server and they do upgrades on their own timetable. They were previously running a version slighly older than 4.0.6. I have now included the db link as a parameter in all instances of mysql_insert_id and everything is back to working fine. Previous Comments: [2002-05-06 16:19:54] [EMAIL PROTECTED] First you said, you have the problem with 4.1.2 (as stated in this report Version: field) and the same problem with 4.0.6 . So which version did worked for you and from which version did you upgrade to 4.1.2 where it broke? [2002-05-06 16:11:31] [EMAIL PROTECTED] Several scripts broke on two different servers when a php upgrade was made. The db query is an insert and the mysql_insert_id now requires a parameter to work properly whereas before it did not. [2002-05-06 16:03:46] [EMAIL PROTECTED] sorry. I meant mysql_insert_id [2002-05-06 15:49:12] [EMAIL PROTECTED] mysql_insert_id() only returns something if: -the most recent query was an INSERT query -AND you're using a AUTO_INCREMENT (and thus PRIMARY KEY) field in the table you're inserting data to. If that's not the case, mysql_insert_id() will return 0. [2002-05-06 15:40:13] [EMAIL PROTECTED] I think you meant mysql_insert_id(), right? The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/17049 -- Edit this bug report at http://bugs.php.net/?id=17049&edit=1
Bug #17049 Updated: mysql_insert_id not working
ID: 17049 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback Bug Type: MySQL related Operating System: FreeBSD PHP Version: 4.1.2 New Comment: First you said, you have the problem with 4.1.2 (as stated in this report Version: field) and the same problem with 4.0.6 . So which version did worked for you and from which version did you upgrade to 4.1.2 where it broke? Previous Comments: [2002-05-06 16:11:31] [EMAIL PROTECTED] Several scripts broke on two different servers when a php upgrade was made. The db query is an insert and the mysql_insert_id now requires a parameter to work properly whereas before it did not. [2002-05-06 16:03:46] [EMAIL PROTECTED] sorry. I meant mysql_insert_id [2002-05-06 15:49:12] [EMAIL PROTECTED] mysql_insert_id() only returns something if: -the most recent query was an INSERT query -AND you're using a AUTO_INCREMENT (and thus PRIMARY KEY) field in the table you're inserting data to. If that's not the case, mysql_insert_id() will return 0. [2002-05-06 15:40:13] [EMAIL PROTECTED] I think you meant mysql_insert_id(), right? [2002-05-06 15:34:55] [EMAIL PROTECTED] when mysql_insert_db is used without a parameter, as in mysql_insert_db(), it seems to always return 0 instead of the primary key of the most recent insert. It works fine when the db_link is provided as a parameter. Same problem in PHP 4.0.6 running on Linux. -- Edit this bug report at http://bugs.php.net/?id=17049&edit=1
Bug #17049 Updated: mysql_insert_id not working
ID: 17049 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: MySQL related Operating System: FreeBSD PHP Version: 4.1.2 New Comment: Several scripts broke on two different servers when a php upgrade was made. The db query is an insert and the mysql_insert_id now requires a parameter to work properly whereas before it did not. Previous Comments: [2002-05-06 16:03:46] [EMAIL PROTECTED] sorry. I meant mysql_insert_id [2002-05-06 15:49:12] [EMAIL PROTECTED] mysql_insert_id() only returns something if: -the most recent query was an INSERT query -AND you're using a AUTO_INCREMENT (and thus PRIMARY KEY) field in the table you're inserting data to. If that's not the case, mysql_insert_id() will return 0. [2002-05-06 15:40:13] [EMAIL PROTECTED] I think you meant mysql_insert_id(), right? [2002-05-06 15:34:55] [EMAIL PROTECTED] when mysql_insert_db is used without a parameter, as in mysql_insert_db(), it seems to always return 0 instead of the primary key of the most recent insert. It works fine when the db_link is provided as a parameter. Same problem in PHP 4.0.6 running on Linux. -- Edit this bug report at http://bugs.php.net/?id=17049&edit=1
Bug #17049 Updated: mysql_insert_id not working
ID: 17049 Updated by: [EMAIL PROTECTED] -Summary: mysql_insert_db not working Reported By: [EMAIL PROTECTED] -Status: Feedback +Status: Open Bug Type: MySQL related Operating System: FreeBSD PHP Version: 4.1.2 New Comment: sorry. I meant mysql_insert_id Previous Comments: [2002-05-06 15:49:12] [EMAIL PROTECTED] mysql_insert_id() only returns something if: -the most recent query was an INSERT query -AND you're using a AUTO_INCREMENT (and thus PRIMARY KEY) field in the table you're inserting data to. If that's not the case, mysql_insert_id() will return 0. [2002-05-06 15:40:13] [EMAIL PROTECTED] I think you meant mysql_insert_id(), right? [2002-05-06 15:34:55] [EMAIL PROTECTED] when mysql_insert_db is used without a parameter, as in mysql_insert_db(), it seems to always return 0 instead of the primary key of the most recent insert. It works fine when the db_link is provided as a parameter. Same problem in PHP 4.0.6 running on Linux. -- Edit this bug report at http://bugs.php.net/?id=17049&edit=1