store the javascript variable in the database in php

In php, I try to get the visitor's screen resolution of the website using 2 different javascript commands.

$ width = "";
$ height = "";

AND

$ width = "";
$ height = "";

$ screenres = $ width. "X". $ height;

When I echo $ variable screenres in php i get a correct screen resolution but when i try to save that variable in the sql database then i "