You've got quite a few errors in both your JavaScript and PHP, which probably explains the lack of answers. Utilizing AJAX using jQuery and PHP can be a bit confusing at first, I've tried to make some sense of what you're doing here:
http://snipt.net/jakemcgraw/jquery-listserv-answer-ajax-comment-list - jake On Tue, Apr 28, 2009 at 12:17 PM, fluxUX <martine...@gmail.com> wrote: > > I want to display an unordered list of comments from my echoed JSON > result using this jQuery code block: > > $("#goComment").click(function(){ > > bigComment = $("#bigComment").val(); > > $.post("i-upComments.php", { //this inserts the > comment > into the 'comments' table in the DB > > bigComment: bigComment, > u: u, > > }, function(data){ > > //display the list of comments as a unordered list - LI > > }); > > }); > > ----------------- > Here is my PHP: > > <?php > > include_once("db.php"); > > $u = 'Jl6XR'; > > $sql = "SELECT * FROM bigNest INNER JOIN comments ON comments.u = > bigNest.uid"; > > $result = mysql_query($sql); > > while($array = mysql_fetch_array($result)) { > > $bigtitle = $array[bigtitle]; > $bigbody = $array[bigbody]; > $comments = $array[comments]; > } > > $val = array("bigtitle" => $bigtitle, > "bigbody" => $bigbody, > "comments" => $comments, > > ); > > $output = json_encode($val); > echo $output."\n"; > > > ?> >