Hi All, Thank you so much, I did just next to insert query $id=@mysql_insert_id(); its given me id, its working fine as i have checked. Thank you so much for help. I am new learning through book, thats y i do basic mistakes. Thanks a lot. Arvind --- In php-objects@xxxxxxxxxxxxxxx, Joe Forsythe <jforsythe@...> wrote: > > There are several courses of action that you can take: > 1. Do as was suggested before and don't insert the data until you > actually have all of it. > 2. Revise your header() to include the id, so ?name=$username&id=$id > 3. Pull your id from the database based on the user name, since your > user name should be different for everyone anyways. > -- > Joe > > > On Feb 26, 2009, at 5:34 PM, arvindsri123 wrote: > > > > > Hi All, > > > > Thank you so much, Actually on first page i wil insert data into table > > and on the second page i think i need to update table with new data, > > but as i need to send primary key to 2nd page, but i am not able to > > send that to 2nd page, other thing is goingbut when i am trying to > > redirect its sending these type of data > > > > header("Location: age.php?name=$username") ; > > > > not sending >>header("Location: age.php?id=$id") ; > > > > how i can get id at first page to send with redirect ?? > > > > Thanks, > > Arvind > > > > --- In php-objects@xxxxxxxxxxxxxxx, Brian H <brianh781@> wrote: > > > > > > Do this: > > > > > > First page... > > > > > > $sql = "UPDATE agreement SET Field1 = Value1, Field2 = Value2, ... > > Field10 = > > > Value10 WHERE ID = IDValue"; > > > > > > > > > Second page... > > > > > > $sql = "UPDATE agreement SET Field11 = Value11, Field12 = > > Value12, ... > > > Field15 = Value15 WHERE ID = IDValue"; > > > > > > > > > You will need to pass the value for the primary key from one page > > to the > > > next. > > > > > > Another option... > > > > > > Instead of writing the first query to the db, save it in an array > > and store > > > it as a session variable. Then, complete the session variable > > (array) on > > > the second page, and write all of the fields to the db at once. > > Then, > > > destroy the session variable. This will keep the record from being > > > half-completed if the browser is closed for some reason, or other > > problem > > > occurs. > > > > > > On Thu, Feb 26, 2009 at 2:54 PM, Joe Forsythe > > > <jforsythe@>wrote: > > > > > > > You are still doing an update. You are just updating the last 5 > > > > fields in the table with the new information. > > > > -- > > > > Joe > > > > > > > > > > > > On Feb 26, 2009, at 2:46 PM, arvindsri123 wrote: > > > > > > > > > Hi All, > > > > > > > > > > I have a new problem now, > > > > > > > > > > I have a table(agreement) with 15 fields/column, and i have 2 > > page, on > > > > > first page there is 10 forms fields, and on 2nd page 5 forms > > fields. > > > > > > > > > > when user(arvind) will come on first page, will fill all the > > 10fields > > > > > and will click submit button, all the 10 fields info will > > store in > > > > > table, and the user(arvind) will reach on 2nd page and here > > he will > > > > > again fill all the 5 fields and will click submit. > > > > > > > > > > how i can do that ? I know normal update query which does update > > > > > existing data, but here case is differ, i don't need to update > > > > > existing data, i need to add rest 5 fields to fill by new data. > > > > > > > > > > I hope all of u wil understand my probs, i tried to explain as > > much as > > > > > i can. > > > > > > > > > > waiting for help. > > > > > > > > > > Thanks, > > > > > Arvind > > > > > > > > [Non-text portions of this message have been removed] > > > > > > > > > > > > > > > > > > > > > [Non-text portions of this message have been removed] > > > > > > > > > > > > > [Non-text portions of this message have been removed] >