How do I can extract list from database by control value in URL
===

Can anyone tell me, how do I can extract list by query WHERE??

For example I have URL mypage.com/page.php?contentid=3fgyfg733f43 my JSON script doesn`t extract data by contentid.

[here is the extraction source][1]


and

[here is JavaScript instead of header to get value from current 'contentid'][2]

this 

    $.getJSON("resources/lib/comments.php?listdata=<? echo $_GET['contentid']; ?>&jsoncallback=?", function(data) {

doesn`t work and doesnt extract data from mysql by identificator in value 'listdata'!

  [1]: http://paste.php.lv/70fcdc3808675836e8dd952d6dd50224?lang=php
  [2]: http://paste.php.lv/d842730e69187a79dab47b3a11d143d4?lang=javascript