I need to make a moderate system like the one in fmylife.com. Basically the problem I have is loading the MySQL query using Ajax (without page refreshing) in to a div.
MySQL query
$sql = mysql_query(“SELECT * FROM posts WHERE active =’0’” LIMIT 1) or die (mysql_error());
$row = mysql_fetch_array($sql);
HTML
<div class=”post-body”><?php echo $row[‘sitepost’];?></div>
this data should be reloaded when pressing “yes” or “no” buttons. thanks in advance.
@mgraph is close but if you want to do this on a button click
in post.php:
JS:
HTML:
Alternate HTML/JS