How do I echo saved data outside the function?

You’d need to declare $lineOne as global inside your function:

global $lineOne;

Messy way of coding though.

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