Question: Alright, I'm pretty desperate. This is my first time using StackOverflow (I've always find all my answer but not this time). Please Community I need your help cause I'm not a SQL wiz. (I'm using Access).

I have 3 tables "User", "Type" and "User\_update". I want to get the value from the "User" table but if there's an update for that user in the "User\_update" table I would like to have the value from the "User\_update" table instead and the date of the update. :-/

```
TABLE "USER"
id | user | type_id
--------------------
0  | bibi | 1
1  | toto | 1

TABLE "TYPE"
id | type
-----------
0  | admin
1  | normal

TABLE "USER_UPDATE"
id | user_id | type_id | date
-----------------------------------
0  | 1       | 0       | 9/3/2015

```

Would like to get something like this:

```
user | type   | date
--------------------
bibi | normal | 
toto | admin  | 9/3/2015

```

Hope you guys can help!

Answer: 
First check that the `session_start();` is added on your first line of your file. Then put the below code.

```
<?php if($_SESSION['usr'] == 'xyz'){
    //Put the buttons which you want to display on when the use is XYZ.
} else {
    //Put the buttons which you want to display on when the use is ABC.
} ?>

```
HTML Code: 

```
<div class="form" id="xyz" style="display: none;">
<div class="form" id="abc" style="display: none;">  

```

PHP Code: 

```
<?php 
    if ($_SESSION['usr'] == 'xyz') {
       $showdiv = 'xyz';
    }
    else if ($_SESSION['usr'] == 'abc') {
       $showdiv = 'abc';
    }

    echo "<script type=\"text/javascript\">document.getElementById('".$showdiv."').style.display = 'block';</script>";
?>

```