Hello guys!
My idea is to pull private messages to the user using PHP from MySQL, then when the user click on <div> element, then it should fadeIn() the message for him.
Let's see it in action:
PHP Code:
<script type="text/javascript">
$(document).ready(function(){
$("#subj").click(function(){
$("#msgBox").css('display', 'inline').fadeIn(3000);
});
}
});
</script>
<?
// PHP code!
// query to get the messages!
$SQL = mysql_query("SELECT * FROM msg WHERE to_id = '".$userid."' AND `read` = \"0\"")or die(mysql_error());
// loop and pull more msgs !
while($row = mysql_fetch_array($SQL)){
// Only a function to get the username instead of user id! do not see it!
$sender = sender($row["from_id"],$row["to_id"] );
// Out put format!
echo 'From: '.$sender[0].' |,| And To '.$row["to_id"].' |,| subject! is:';
// Subject here! look in it has span id of *SUBJ* !
echo '<span id="subj"><font color="red">'.$row["subj"].'</font></span>';
// The Private message!
echo '<span id="msgBox" style="display:none;">'.$row["msg"].'</span>';
}
?>
This couldn't work!
it only works with the *FIRST* record of private messages!
But doesn't with the second message!
Help would be appreciated!