tag:blogger.com,1999:blog-5813540589519490137.post8721292187957356619..comments2023-06-29T14:23:40.994+05:30Comments on MY NODE: How to get the MySql last inserted row using PHP?my nodehttp://www.blogger.com/profile/08007538405198874666noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-5813540589519490137.post-54108436651176805282013-03-10T22:58:18.864+05:302013-03-10T22:58:18.864+05:30thank you SO MUCH!!!!!thank you SO MUCH!!!!!Unknownhttps://www.blogger.com/profile/09522144452387070903noreply@blogger.comtag:blogger.com,1999:blog-5813540589519490137.post-84083808641524563092012-02-06T12:26:08.322+05:302012-02-06T12:26:08.322+05:30Thank You Very Much....I just wanted this!Thank You Very Much....I just wanted this!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5813540589519490137.post-39696495873115553112011-08-10T04:53:24.082+05:302011-08-10T04:53:24.082+05:30If you insert more than 1 VALUE it returns only de...If you insert more than 1 VALUE it returns only de first inserted ID :(<br />----------------------------------<br />mysql_select_db($database_cnn_sis, $cnn_sis);<br />$str = "INSERT INTO emails VALUES (NULL,2,'asd'),(NULL,2,'asd'),(NULL,2,'asd'),";<br />$str = substr($str,0,(strlen($str)-1));<br />$strLastID = mysql_query($str);<br />$last_id = mysql_insert_id();<br />echo $last_id.' -- '.mysql_info();<br /><br />//1 -- Records: 3 Duplicates: 0 Warnings: 0Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5813540589519490137.post-25865889632117733462011-07-08T09:26:32.752+05:302011-07-08T09:26:32.752+05:30Brilliant. Just what I wanted. Thanks for posting ...Brilliant. Just what I wanted. Thanks for posting this.Dintherhttps://www.blogger.com/profile/09444894238003853527noreply@blogger.comtag:blogger.com,1999:blog-5813540589519490137.post-38491953057823012302010-12-13T17:11:14.149+05:302010-12-13T17:11:14.149+05:30of course, just do it:
$last_id = mysql_insert_id(...of course, just do it:<br />$last_id = mysql_insert_id();<br />(without that last ")" that was given in the example)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5813540589519490137.post-56539155328598992142009-06-15T18:20:25.554+05:302009-06-15T18:20:25.554+05:30Thanks, Thanks a lot, It is much easier in MySQl t...Thanks, Thanks a lot, It is much easier in MySQl than MS SQlAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5813540589519490137.post-66692085067149115942008-09-25T11:52:00.000+05:302008-09-25T11:52:00.000+05:30thank you very much toowilsonwilsonelec@gmail.comthank you very much too<BR/><BR/>wilson<BR/>wilsonelec@gmail.comAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5813540589519490137.post-31793168197525334922008-08-11T14:24:00.000+05:302008-08-11T14:24:00.000+05:30Thank you very much for the code. Exactly what I n...Thank you very much for the code. Exactly what I needed!Anonymousnoreply@blogger.com