Question: I have recently published my website on Hostgator and I have a problem with the sessions.
I have a session start on multiple pages: config.php, login.php, logout.php, index.php.

I have tried everything out there in with checking the whitespace, adding to the .httpaccess file, adding @ob\_start()...and nothing seems to work.
In the error.log I have the following error:

> 
> PHP Warning: session\_start(): Cannot start session when headers
> already sent in ../config.php on line 3
> 
> 
> 

Can you please help me?

Answer: 
Try this, but it is more correct to use the date field:

```
UPDATE your_table
SET
    days = mod(days,30),
    months = mod(months,12) + trunc(days/30),
    years = years + trunc(months/12);

COMMIT;

```
Try this. However, I think it should be 1 year, 3 months and 9 days though, Kindly let me know otherwise.

```
UPDATE your_table
SET
    days = days - 30,
    months = months + 1
WHERE
    days > 30;

COMMIT;

UPDATE your_table
SET
    months = months - 12,
    years = years + 1
WHERE
    months > 12;

COMMIT;

```

Output:

```
Empno Empname Years Months Days
-------------------------------
  111   Ahmed      1     3    9

```