title: php sql MAX(primarykey)
body: <pre><code>$show=mysql_query("SELECT MAX(photoid) FROM photos WHERE userid='".$_SESSION['user']."'");
  $row = mysql_fetch_array($show);
  $newpp=mysql_query("UPDATE photos SET pp='1' WHERE photoid='".$row['photoid']."'");
  </code></pre>
  
  <p>The code displayed is meant to change a value 'pp' to 1  once run.
  The condition for the exact row to be change is MAX(photo) where photoid happens to be the primary key.
  The value pp on the max photoid is not changing. What could be the problem.</p>