Have I got this IF Statement correct?

You have a typo in $_SESSION['odertype'], should be $_SESSION['ordertype']. You are also ASSIGNING a value instead of testing it for equivalency, try ==.

If in doubt you can always use var_dump($_SESSION) to get all the values stored there.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)