title: Trying to get data from a button and have a tailored popup with jquery
body: <p>I am using a modal dialog opener that I want to open when a user clicks one of a few available buttons.  The buttons all have a different "artist_id" associated with them.  When a button is clicked, I also have a php script that should run and put the user id and artist id in a table that keeps track of the "liking" relationships.  Below is the relevant code:</p>
  
  <p>index.php:</p>
  
  <pre><code>//script
  &lt;script&gt;
  $(function() {
    $( "#dialog-modal" ).dialog({autoOpen: false, height: 250, width: 400, modal: true});
  
    $( "#opener" ).click(function() {
                         $( "#dialog-modal" ).dialog( "open" );
  
                         $.get('/like_artist.php', {artist_id : $(this).data('artist_id')})
                         .done(function(data) {
  
                               alert("Data Loaded: " + data.artist_id);
  
                               });
  
          });
  
    });
  &lt;/script&gt;
  </code></pre>
  
  <p>//button:</p>
  
  <pre><code>&lt;button type="button" id="opener" data-artist_id="1"&gt;Play My City&lt;/button&gt;
  </code></pre>
  
  <p>//dialog content (I would like to have this change based on the button clicked):</p>
  
  <pre><code>&lt;div id="dialog-modal" title="Basic dialog"&gt;
  &lt;p&gt;You have just liked ...&lt;/p&gt;
  
  &lt;p&gt;This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>like_artist.php: takes a user id and artist id and puts them in the relationship table user_artists </p>
  
  <pre><code>&lt;?php 
  
  session_start();
  require_once "database.php";
  db_connect();
  require_once "auth.php";
  $current_user = current_user();
  include_once("config.php");
  
      $artist_id = $_GET['artist_id'];
  
      $user_id = $current_user['id'];
  
      $query = "INSERT INTO `user_artists`
      (`artist_id`, `user_id`)
      VALUES
      (''$artist_id', '$user_id')";
  
      $result = mysql_query($query);
  
  ?&gt;
  </code></pre>
  
  <p>The alert I have put in the top script is there to see if I am getting the correct artist_id from the data-artist_id property, but it is not returning anything.  </p>
  
  <p>Thank you for your help!</p>