I have something like this:
<input id="num" type="text">
// var num = $("#num").val();
< ?php
$sql=mysql_query("SELECT * FROM news WHERE
id= num //???
");
while($row=mysql_fetch_array($sql))
{
?>
< div id="main">
< ?php echo $row['title']; ?>
< ?php echo $row['body']; ?>
< /div>
< ?php
}
how do I write in input id num and view new news without refreshing the page? I know that I have to use jquery and ajax. i can do it in only jquery, but i cant combine this with PHP.
thanks!
have you considered using Json , Jquery , PHP together ? Call a page at some interval using jquery.This might give some pointers .
DisplayNews.php
GetNews.php