I'm trying to select various bits of data out of my insert.php page. Such as post id, username and users id so far.. And I will be adding other bits of selected data. Now I could get the id of the div with response, but when I added more queries and echo them out they ended up all together so I had my postidusernameuserid all in one string. How do I separate them?
Also I'm aware of the depreciated MYSQL_ I just haven't got around to updating my code yet.
AJAX
<script>
$(document).ready(function(){
$("form#myform").submit(function(event) {
event.preventDefault();
var content = $("#toid").val();
var newmsg = $("#newmsg").val();
$.ajax({
type: "POST",
url: "insert.php",
data: {toid:content, newmsg: newmsg},
success: function(response){
$("#homestatusid").prepend("<div id='divider-"+response+"'><div class='userinfo'>"+newmsg+"<a href='/profile.php?username="+response+"'><img class='stream_profileimage' style='border:none;padding:0px;display:inline;' border=\"0\" src=\"imgs/cropped"+response+".jpg\" onerror='this.src=\"img/no_profile_img.jpeg\"' width=\"40\" height=\"40\" ></a><div style='cursor:pointer;position:relative;top:0px;float:right;padding-right:5px;' onclick=\"delete_('"+response+"');\">X</div></div></div>");
}
});
});
});
</script>
INSERT.PHP
$check = "SELECT streamitem_id FROM streamdata";
$check1 = mysql_query($check);
$resultArr = mysql_fetch_array($check1);
echo $resultArr['streamitem_id'];
$check = "SELECT username,id FROM users";
$check1 = mysql_query($check);
$resultArr = mysql_fetch_array($check1);
echo $resultArr['username'];
echo $resultArr['id'];
Is it a case of success: function(response,responsetwo){ and so on.