Q:

Getting empty data in AJAX after POST

I'm building a Trading system and I'm using php to get some data, but when it arrives it is empty. It's the first time I use AJAX and I don't know what am I doing wrong. Here is my code:
Script:
$(document).ready(function() {

    $('#submit').click(function(){

        //Get the values
        var amount     = $('#amount').val();
        var from       = $('#from').val();
        var to         = $('#to').val();

        var params = 'select * from yahoo.finance.xchange where pair in ("' + from + to +'")';
        console.log( params );
        $.ajax({
            type: "POST",
            url: "currencies.php",
            data: params,
            success: function(data){
                $('#result').html(data);
                alert(data); //I'm alerting because I was not receiving nothing at #result

            }
        });
    });
});

PHP:
$BASE_URL = "http://query.yahooapis.com/v1/public/yql";

$yql_query = $_REQUEST['params'];
$yql_query_url = $BASE_URL . "?q=" . urlencode($yql_query) . "&format=json" . "&env=http://datatables.org/alltables.env";

$session = curl_init($yql_query_url);
curl_setopt($session2, CURLOPT_RETURNTRANSFER,true);
$json = curl_exec($session);

$phpObj =  json_decode($json);
$conversiones = $phpObj->query->results->rate;
$title = new ArrayObject();

$title = "$conversiones->Name";

echo $title;

I typed:
params=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20("MXNUSD")

in the URL, to see if the PHP file is working and it is. It echoes the Name of the currencies, but is not received in the script.
Thanks in advance.
EDIT: Fixed typos.

A:

You need to send a key/value pair. All you are sending is a value without the params key.
The key is what you are using in your php $_REQUEST['params']
Look in your browser console network tab and you won't see the same url as what you manually put in address bar
Try
  $.ajax({
        type: "POST",
        url: "currencies.php",
        data: {params: params}, // object for key/value
        success: function(data){
            $('#result').html(data);
            alert(data); 

        }
    });

Also note that you can only print the json without any extra echo in php. Otherwise will get json parse error in ajax
Just as an FYI - you can make this same request directly to Yahoo right from browser without a proxy in php on your server. See YQL Console

