Edited after venkat's comment:-
According to your last comment, the code you have problems with is the following:-
<?php
$link="www.google.com";
echo "<a href='#' onclick=window.location='$link'>Click here</a>";
?>
This above code should actually be the following:-
<?php
$link = "http://www.google.com/";
echo '<a href="'.$link.'">Click here</a>';
?>
The reason for adding the "http://" string is that the variable "$link" is going to be used as an HTTP URL, which requires mentioning of this "http://" string, mainly because of the protocol to be used by the browser. In this case, the protocol is HTTP.
Always remember that for any URL, there must be a string "http://" at the beginning of the URL string, when stored in either a database / variable.
Coming back to the code in your question, which was:-
<?php
// getting from database
echo '<li onclick=\"window.location='.$result->website.'\"><a href="#">'.$result->option.'</a></li>';
?>
Now here the position of "window.location
" is not totally correct. It should have been in "href" attribute of "a" element, instead of putting it in "onclick" attribute of "li" element.
So the code should actually be:-
<?php
// getting from database
echo '<li><a href="'.$result->website.'">'.$result->option.'</a></li>';
?>
Hope it helps.