Jump to content

Recommended Posts

i have 2 tables in my database. which are 'personal' and 'education'.

both hav 'identity_number' field.

 

first, i fill the personal form. and the 'identity_number' will automatically insert into both tables.

 

but when i want to fill the education form, the data didnt update the existing data but inserted into the next row. how can i call the 'identity_number' from 'education' and update it? btw, the education form need to be fill again if the user have more than one... can u help me? i'm not really good in php and sql... but i really want to do this... please...

You're going to have to be a bit more specific, and also show us some code.  I think you're saying you have two tables and you want them both to hold the same info, so if someone has never filled out either of the forms, it will insert the info into both tables, but if someone has filled out one but not the other, it only inserts into one table?  If that is what you're saying, then I think you're going about this all wrong.

 

First off, why do you need two different tables that hold the exact same information?  And if for some reason you just *need* to have two tables with the same information (which seriously, I can't think of a reason why you would), just have it insert the data into both tables no matter which form is filled out, to begin with.  That solves the whole "if one filled but not the other" scenario...unless you have "grandfathered" people already in one or the other table and your making this whole new system and you want to be able to accommodate that. 

 

But if that's what you are doing, why not just force everybody to refill one of it out? Problem solved.  Or just make a quick script to copy the info from 1 to the other - problem solved.  As far as this:

 

the education form need to be fill again if the user have more than one...

 

Again, we aren't in your situation, so that doesn't really mean a whole lot to us.  You're going to have to get a lot more detailed about your question and situation. 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.