title: php while but the result have to shows in javascript
body: <p>I have the following code and what I'm trying to do is to show the mysql result in the message box with javascript, but when I click on the message box it shows me only one result for every button.</p>
  
  <p>I want every button have his own message which is in database.</p>
  
  <p>Does anybody have an idea on how I can do it?</p>
  
  <pre><code>    &lt;?
      $query = "SELECT *  FROM `Points`";
      $result = mysql_query($query);
      while($row = mysql_fetch_assoc($result)){
      ?&gt;
  
      &lt;div style="position:absolute; overflow:hidden; &lt;?php echo $row[Pos]; ?&gt; height:23px; z-index:0"&gt;
  &lt;button onClick="showMsgBox();" id="showBtn"&gt;Show MsgBox&lt;/button&gt;
  &lt;/div&gt;  
  &lt;script&gt;
  
              $("#showBtn").focus();
              msgBoxImagePath = "images/";
              function showMsgBox() {
                  $.msgBox({
                      title: "Ads",
                      content: "&lt;? echo $row[Ctn]; ?&gt;",
                      type: "alert"
                  });
              }
          &lt;/script&gt;
  
      &lt;?}?&gt;
  </code></pre>
  
  <p>In the database Pos is the position of the button and Ctn is the message.</p>
  
  <p>Please help.</p>