Please don't ask why I use `mysql_*` functions. I just need to use this for now so please don't suggest `mysqli_*` functions and `PDO` cause i'm aware of that.   

My problem is that my query doesn't return any data. But when I tried to run the `sql` in my server it worked so I just don't know what I'm missing right now. So please help.  
 Here is my `script`:

```
   $(document).on('click','#btn-generate-pdf',function(){
        var date = $('#service-date').val(),
            dataString = "date="+ date;
            $.ajax({
                type: "POST",
                url: "functionko.php?call=retrievedate",
                data: dataString,
                success:function(data){
                    $('#services-container').html(data);
                }
            });         
    });

```

And here is my `functionko.php`

```
   switch($_GET['call']){   
  case 'test':
    checkuser();
     break;
  case 'getuser';
    getuser();  
    break;
  case 'paybill';
    paybill();
    break;
  case 'retrievedate';
    retrievedate(); //<-----
    break;  
  default:
    break;
 }

    function retrievedate(){
    $date = '2013-12-19';
    //$date = $_POST['date'];
    $sql = "SELECT * FROM rendered_services WHERE rendered_date = '$date'";
    $result = mysql_query($sql);
    $data= array();
    print_r($sql);
    if($result){
        while($row = mysql_fetch_assoc($result)){
            echo $row['client_name'];
        }
    }else{
        echo '
        <table border="0"  width="100%" cellpadding="0" cellspacing="0"  class="display" id="attendance" class="jtable" >       
            <thead>
                <tr>
                    <th>Client Name</th>
                    <th>Service Name</th>                       
                    <th>Date</th>
                    <th>Therapist</th>
                    <th>Status</th>
                    <th>Price</th>
                    <th>Subtotal</th>
                </tr>
            </thead>
            <tbody>
            </tbody>
        </table>';
    }

```

So what I'm missing here? TIA!