Can you see anything that might cause this to not work?
I have a MYSQL connection, the variables are right. I have <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
inside my head. What next?
javascript:
function ratePost(id) {
$.ajax({type: "POST", url: "ajax.php?action=ratePost"});
}
ajax.php?action=ratePost:
$postID = $_POST['postID'];
$rating = $_POST['rating'];
mysql_query("INSERT INTO userpostratings (postID, rating) VALUES ($postID, $rating)");
<a href="#" alt="+ (Up Vote)" class="vote" onclick="ratePost('postID=<?=$post['id'] ?>', rating=<?=$post['rating']?>, <?=$post['id'] ?>);return false;" rel="nofollow" title="Up vote this post">+</a>
Thanks alot hope you can help a noob