I have the following table in a MYSQL database:
Messages
MessageId (PK) int(10) - auto_inc
Message varchar(100)
I have the following PHP that echos a particular message:
<?php
//..connect to database
$query = "SELECT Message FROM Messages WHERE MessageId = '1'";
$result = mysql_query($query);
$num = mysql_num_rows( $result );
if ($num == 1){
$row = mysql_fetch_assoc($result);
echo json_encode($row);
}else{
echo('Invalid');
}
?>
Can anyone advise me on how best to integrate jQuery in order to allow the document browser window to write the response...
Content-Type: application/json) in order for these frameworks suggested by @Jonathan to work.