pstanbra Posted February 15, 2007 Share Posted February 15, 2007 I'm using paypal IPN to send data to a mySQL db - no problems there. As paypal only accepts so many "custom" variables - i need to set my return page to another form to accept more details and then add to the db. So here is my question. In the table - there is an ID as the unique key. When I write my paypal values to the db - the ID is automatically generated and isnt in a VARIABLE. soooooooo!!!! If I write a function to put the extra variables from a form into the same row in the table - how do i do this. Do i - Select the last row of the database and add the extra values to my newly added fields in the table or - is there another way to do this. If I select the last row of the table - is there not a possibility of this being a new row created by another record a second ago . How safe is selecting the last row. What do you suggest. Quote Link to comment https://forums.phpfreaks.com/topic/38612-simple-question-i-think/ Share on other sites More sharing options...
scottybwoy Posted February 15, 2007 Share Posted February 15, 2007 Is their a way of telling what data is added first to use as a handle for the row you want to add the data too, then you can use UPDATE table SET col1='$var1', col2='$var2' WHERE col3='$var3' Otherwise there is no way of testing where you put the data. So use Select on a column where you will know the data i.e name or timestamp both would be better then use one of those to update the specific row, good luck Quote Link to comment https://forums.phpfreaks.com/topic/38612-simple-question-i-think/#findComment-185297 Share on other sites More sharing options...
sasa Posted February 15, 2007 Share Posted February 15, 2007 look function mysql_insert_id() Quote Link to comment https://forums.phpfreaks.com/topic/38612-simple-question-i-think/#findComment-185724 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.