I have this javascript function

This code opens page in a new window

```
<script language="javascript" type="text/javascript">
    function OpenPopupCenter(pageURL, title, w, h) {
        var left = (screen.width - w) / 2;
        var top = (screen.height - h) / 4;  // for 25% - devide by 4  |  for 33% - devide by 3
        var targetWin = window.open(pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
    } 
</script>

```

Now I have this code to get the Id from a MySQL Database which looks like this :

```
<?php
require_once('inc/config.php');

$con = mysqli_connect($host,$user,$pass,$db) or die ('Cannot connect: '.mysqli_error());

$query = "SELECT * FROM new_reservation";
$result = mysqli_query($con,$query) or die('Bad Query: '.mysqli_error($con));
while($row = mysqli_fetch_array($result)){

$ResID = $row['id'];

}
?>

```

Now I want to use this same ID in the javascript function I created like so

```
onclick=\"OpenPopupCenter('signout_visitor.php?id=', 'TEST!?', 1200, 600);\"

```

I am not quite sure how to use this. Quite a bit new to using variables in popup windows for javascript hence i would be needing some form of clarification here.

**Edit**

I am using it in a Table like this 

```
<?php
require_once('inc/config.php');
$con = mysqli_connect($host, $user, $pass, $db) or die ('Cannot connect, Reason: '.mysqli_error());
$sql = "select * from new_reservation ";
$result = mysqli_query($con,$sql) or die ('Failed Query , Reason : '.mysqli_error($con));
while($row = mysqli_fetch_array($result)){

    $showData = "<TR valign=top>
<TD width=106 height=26><div class=wpmd>
<div align=center><font face=Verdana size=1><BR></font></div>
<div align=center><font face=Verdana size=1>&nbsp;&nbsp; {$row['visit_date']}</font></div>
</div>
</TD>
<TD width=134 height=26><div class=wpmd>
<div align=center><font face=Verdana size=1><BR></font></div>
<div align=center><font face=Verdana size=1>&nbsp; {$row['login_time']}</font></div>
</div>
</TD>
<TD width=148 height=26><div class=wpmd>
<div><font face=Verdana size=1><BR></font></div>
<div><font face=Verdana size=1>&nbsp;&nbsp;&nbsp; {$row['fullname']}</font></div>
</div>
</TD>
<TD width=160 height=26><div class=wpmd>
<div align=center><font face=Verdana size=1><BR></font></div>
<div align=center><font face=Verdana size=1>&nbsp;&nbsp; {$row['whom_tosee']}</font></div>
</div>
</TD>
<TD width=138 height=26><div class=wpmd>
<div>&nbsp;</div>
<div align=center><font face=Verdana><input type=image src=images/show_detailsbtn.png width=124 height=26 onclick=\"OpenPopupCenter('shownewvisitdetails.php?id=$ResID', 'TEST!?', 1200, 600);\" ></font></div>
</div>
</TD>
<TD width=163 height=26><div class=wpmd>
<div><BR></div>
<div>&nbsp;<font face=Verdana size=2>
    <input type=image src=images/signout_visitor.png width=121 height=27 onclick=\"OpenPopupCenter('signout_visitor.php?id=$ResID', 'TEST!?', 1200, 600);\"></font></div>
</div>
</TD>
</TR>
";
    echo $showData;

}
?>

```