Brief overview. I'm making a site similar to FML and MyLifeIsAverage. It's called MyLifeIsBal (Balboa is the name of my former HS). mylifeisbal.com I've been learning and building for the past 2 days. Right now, I'm trying to get some barebones going.
The problem I have is when I click on 'like', it doesn't add to 'like' in the database. There's no error message. I'm having a hard time debugging this. Can someone take a look?

index.php
CODE
<?php
$con = mysql_connect("localhost","xxx","xxx");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_select_db("mylifeisbal_zxq_joke", $con);
$result = mysql_query("SELECT * FROM joke");

echo "<p>Here are all the jokes:</p>";

while($row = mysql_fetch_array($result))
  {
  
  echo $row['joketext'];
  echo "<br />";
  echo "#" . $row['id'];
  echo '<a href="votepos.php?myId=' . $row['id'] . '"> Hella Bal: </a> ';
  echo $row['jokepos'];
  echo " Not Bal: ";
  echo $row['jokeneg'];
  echo "<br /><br />";
  }
mysql_close($con);
?>
<br />


votepos.php
CODE
<?php
$id = $_GET['myId'];
header('Location: .');
$con = mysql_connect("localhost","xxx","xxxx");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("mylifeisbal_zxq_joke", $con);

$sql='UPDATE joke
  SET jokepos = jokepos +1
  WHERE id = "$id"';
if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "1 record added";
exit();
?>


Thank you! smile.gif