1) You better don't do it this way. Write a JS-function popup with an argument. THen popup the argument (which is window.open() by the way).
2) in every link you pass the complete url from PHP to JS with simply something like this:
<a href="javascript:newwin('<?echo $row['url']?>');">
3) for the future: ALWAYS explain the error. Noone here has enough time to doublecheck your code. You problem can be either in JS, PHP, MySQL or just because your browser doesn't execute JS. So always give at least an errormessage so that we know where to look at.