PHP/Ajax - Sending a JQuery value to a PHP Script -


i'm having diffiiculty i'm following on elses code, if me appreciate it.

basically have jqgrid displays list of bookings, when double click row opens jqdialog displays details booking.

i have variable defined booking reference want pass php script.

var brdata = rowdata['bookref']; 

i trying send via ajax:

function getgridrow(brdata) {  $.ajax({      // request sent control panel, send cp.request.php (which handler)     url: 'scripts/php/bootstrp/all.request.php',     type: 'post',      data: {          ft: "getdgrow",         type: 'post',         data: 'fnme=getdgrow&row_data='+brdata,         //row_data: rowdata,           id: null,         condition: null     },     datatype: 'xml',     timeout: 20000,     error: function(){         $('#cp-div-error').html('');         $('#cp-div-error').append('<p>there error inserting data, please try again later.</p>');         $('#cp-div-error').dialog('open');     },     success: function(response){       } }); 

this case in all.request.php:

case 'getdgrow': header('content-type: text/xml'); datagridcontroller::getgridrow($_request['row_data']); break; 

and want pass variable 'brdata':

public static function getgridrow($row_data) {       $pdo = new sql();     $dbh = $pdo->connect(database::$serverip, database::$serverport, database::$dbname, database::$user, database::$pass);      try {          $query = "select * tblbookings bookref = '$row_data'"; 

i'm finding confusing @ moment, appreciated. @ moment $row_data php function blank isn't selecting row database.

start verifying javascript function not passing blank variable. try alerting variable "brdata". second, verify if ajax call successful, use of firebug's console. third, make sure php receives , can enter function. may try

public static function getgridrow($row_data) {     echo $row_data;     exit; } 

in php file , alert value in html.

function getgridrow(brdata) {     $.ajax({         //...blah blah blah         success: function(response){             alert(response);         }     }); } 

if can receive alert scripts, guess last thing can try query manually database using value of variable sent php script. knows, there no result produced query.


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -