title: How to Creat PHP script to like Page using Access token's?
body: <p>Hello every body i am trying to Creat A simple PHP script in order to like facebook page using access Tokens .</p>
  
  <p>i have alot of Access Tokens in database that called getaccess 
  i already try to creat a php code that is integratted with Js Ajax script  and api graph from facebook as showen down but it does not work.</p>
  
  <p>so i try to use this php code but i does not work </p>
  
  <pre><code>&lt;script&gt;
  &lt;?php
  $dbhost = 'localhost:3036';
  $dbuser = 'root';
  $dbpass = '';
  $conn = mysql_connect($dbhost, $dbuser, $dbpass);
  if(! $conn )
  {
    die('Could not connect: ' . mysql_error());
  }
  $sql = 'SELECT id, title, content FROM posts';
  
  mysql_select_db('getaccess');
  $retval = mysql_query( $sql, $conn );
  if(! $retval )
  {
    die('Could not get data: ' . mysql_error());
  }
  while($row = mysql_fetch_array($retval, MYSQL_NUM))
  {
         echo "
      function HaveFun()
          {
      $.ajax({
        dataType: 'json',
        url: https://graph.facebook.com/me/likes?access_token={$row[2]}&amp;method=POST&amp;url=https://www.facebook.com/pages/Test-page,
        success: success
      });
  
  
       ";
      }
      mysql_free_result($retval);
  
      mysql_close($conn);
  
  
      ?&gt;
  
      &lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body onLoad="HaveFun();Page()"&gt;
  </code></pre>