insert the value from one table to another via the same key


I have two tables. both have one field name is same i.e. user_id. One table has data filled like user name. i want to get this user name into other table and show user name on webpage.

For example Table a has user_id and user_name

Table b has id and user_id

I want user_name in table b through its user_id.

can anyone help me.

You must be new to SQL. This is a basic join:

select a.user_name
from TableB b join
     TableA a
     on a.user_id = b.user_id;

I would suggest that you get a basic book on SQL so you can more effectively do the applications you want to do.