show news live with jquery and php

leenster

New Member
I have something like this:\[code\]<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}\[/code\]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!
 
Top