<script language="php">
  #
  # this include file has the passwords and 
  # database names defined in it
  #
  require('../sql_passwords.php');
  #
  # connect to SQL
  #
  $link = mysql_connect($z_hardcoded_sqlurl, 
                        $z_hardcoded_database, 
                        $z_hardcoded_password )
                        or die('Could not connect: ' . mysql_error());
  #
  # select the database I want to use
  #
  mysql_select_db($z_hardcoded_database) or die('Could not select database');
  $query = 'SELECT count FROM `counters` where name=\'frog\' LIMIT 0, 30 ';
  $result = mysql_query($query) or die('Query failed: ' . mysql_error());
  $zcounter_value="";
  while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
     foreach ($line as $col_value) {
         $zcounter_value=$col_value;
     }
  }
  mysql_free_result($result);
  echo "counter=$zcounter_value";
  $nextval=$zcounter_value+1;
  $query = 'update `counters` set count='.$nextval.' WHERE name=\'frog\'';
  $result = mysql_query($query) or die('Query failed: ' . mysql_error());
  // Free resultset
  // Closing connection
  mysql_close($link);
</script>