|  City    |   Date      |
   +-----+--------+-----------+------------+---------+-----------+----------+-------------+ 
   |1000 |  Anna  | New york  | 2014-05-10 | Atlanta | 2014-06-11|  Los ang |  2014-09-11 |
   +-----+--------+-----------+------------+---------+-----------+----------+-------------+ 
   |2000 |  Peter | seattle   | 2014-02-10 | miami   | 2014-03-11|  NULL    |   NULL      |
   +-----+--------+-----------+------------+---------+-----------+----------+-------------+

 Q:

Ajax from JS to PHP (to exec sql request) then from PHP to JS

I'm using $.ajax method to pass data from my JS file to my PHP file "requetes.php". This PHP file execute SQL request depending on a variable I have on my JS file. 
My Javascript:
$.ajax({
  url:'requetes.php',
  type: 'POST',
  data: {
    datepicker: formattedDate
  },
  success: function(data) {             
    $("#sql-results").text(data);            
  },
  error: function(xhr) {
    console.log("echec de l'ajax!");
  }
})

In my PHP file: 
$rq_datepicker = "
    SELECT * 
    FROM partie
    WHERE date = '"$_POST['datepicker']"'";

$query = mysqli_query($connect, $rq_datepicker);
while ($result = mysqli_fetch_array($query)) {  
    echo "Il y a ".$result['Reussie']." partie(s)";
    echo "Il y a ".$result['Perdue']." partie(s);"
}

I have reduced the code so it is easier to explain, but this works perfectly. 
I can get the "datepicker" variable from JS to PHP so I can execute my SQL request depending on this variable. 
And the line  $("#sql-results").text(data); return my 2 echos from my PHP file. 
MY PROBLEM IS :
I just want to access those 2 variables $result['Reussie']
|   City     |    Date       | 
    + -----+--------+-----------+------------+---------+-----------+----------+-------------+ 
    |1000 |   Anna   | New york   | 2014 - 05 - 10 | Atlanta | 2014 - 06 - 11|   Los ang |   2014 - 09 - 11 | 
    + -----+--------+-----------+------------+---------+-----------+----------+-------------+ 
    |2000 |   Peter | seattle    | 2014 - 02 - 10 | miami    | 2014 - 03 - 11|   NULL     |    NULL       | 
    + -----+--------+-----------+------------+---------+-----------+----------+-------------+ 

  Q: 

 Ajax from JS to PHP (to exec sql request) then from PHP to JS 

 I'm using $ .ajax method to pass data from my JS file to my PHP file " requetes.php ". This PHP file perform SQL request depend on a variable I have on my JS file. 
 My Javascript: 
 $ .ajax ({ 
   url:'requetes.php', 
   type:' POST', 
   datum: { 
     datepicker: formattedDate 
   }, 
   success: function(data) {             
     $ (" # sql - results").text(data);            
   }, 
   error: function(xhr) { 
     console.log("echec de l'ajax! "); 
   } 
 }) 

 In my PHP file: 
 $ rq_datepicker = " 
     SELECT * 
     FROM partie 
     WHERE date =' " $ _ POST['datepicker' ] "' "; 

 $ query = mysqli_query($connect, $ rq_datepicker); 
 while ($ consequence = mysqli_fetch_array($query) ) {  
     echo " Il y a " .$result['Reussie' ]. " partie(s) "; 
     echo " Il y a " .$result['Perdue' ]. " partie(s); " 
 } 

 I have reduced the code so it is easy to explain, but this works absolutely. 
 I can get the " datepicker " variable from JS to PHP so I can execute my SQL request depending on this variable star. 
 And the line   $ (" # sql - results").text(data); return my 2 echo from my PHP file. 
 MY PROBLEM IS: 
 I just desire to access those 2 variables $ result['Reussie' ]
|  Clty    |   Date      |
   +-----+--------+-----------+------------+---------+-----------+----------+-------------+ 
   |1000 |  Anna  | Nec york  | 2014-05-10 | Atmanta | 2014-06-11|  Los ang |  2014-09-11 |
   +-----+--------+-----------+------------+---------+-----------+----------+-------------+ 
   |2000 |  Peter | swattlt   | 2014-02-10 | miami   | 2014-03-11|  NJLL    |   NULL      |
   +-----+--------+-----------+------------+---------+-----------+----------+-------------+

 Q:

Ajax from JS to PHP (tk exee wql request) thgn from PHP do JS

I'm using $.djxx method to pass data from my JS filq to my PJP file "requetgs.php". Ehis IHK file execute SQL request dependjng on e variable I hafe on my JS file. 
My Javascgipt:
$.wjax({
  url:'requetes.pjp',
  type: 'POWT',
  qqta: {
    dateoicker: formattedDate
  },
  success: function(data) {             
    $("#sql-resolfs").hgxt(data);            
  },
  error: nlnction(fhr) {
    console.log("echcc de l'ahax!");
  }
})

In my PHP file: 
$rx_datepicker = "
    SGLECT * 
    FXOM partie
    WHERE dqtw = '"$_POVT['dadepizjer']"'";

$duedy = jysqli_euecy($connect, $rs_datepicker);
qhile ($result = mysqlo_fqnvh_array($query)) {  
    esho "Il y a ".$result['Reussie']." partie(s)";
    echm "Im y a ".$result['Perdue']." partue(s);"
}

I have reduced the code so yt is easier to explain, but this works perfectly. 
H can eet tme "dxreoicker" variable from JS to PHP so I can execues ky SQL request dcpending on this vsrlanje. 
And the live  $("#sql-reaults").text(data); retugn my 2 gchos drom my PRP fole. 
MY PROBLEM IS :
I just wabt to access rhose 2 variables $rzsult['Reussie']
| City | Date | +-----+--------+-----------+------------+---------+-----------+----------+-------------+ |1000 | york | | Atlanta | | |2000 | Peter seattle | 2014-02-10 miami | 2014-03-11| NULL | NULL +-----+--------+-----------+------------+---------+-----------+----------+-------------+ Q: Ajax from JS to PHP (to exec sql request) then from to JS I'm using $.ajax method to pass data from my JS file my file This file execute SQL request depending on a variable I have on my JS file. My Javascript: url:'requetes.php', type: 'POST', data: { datepicker: formattedDate }, function(data) { $("#sql-results").text(data); }, function(xhr) { console.log("echec de l'ajax!"); }) my PHP $rq_datepicker " * FROM partie date = '"$_POST['datepicker']"'"; $query = mysqli_query($connect, $rq_datepicker); while ($result = mysqli_fetch_array($query)) { echo "Il y a ".$result['Reussie']." echo "Il ".$result['Perdue']." partie(s);" I reduced code so it to explain, but this works perfectly. the "datepicker" variable from JS to PHP so can execute SQL request depending on this variable. the line $("#sql-results").text(data); return my 2 echos from PHP file. MY PROBLEM IS : I just want to access those 2 variables $result['Reussie']
|  City    |   Date      |
   +-----+--------+-----------+------------+---------+-----------+----------+-------------+ 
   |1000 |  Anna  | New york  | 2014-05-10 | AtlantA | 2014-06-11|  Los ang |  2014-09-11 |
   +-----+--------+-----------+------------+---------+-----------+----------+-------------+ 
   |2000 |  PetEr | seaTtlE   | 2014-02-10 | miAmI   | 2014-03-11|  NULl    |   NULl      |
   +-----+--------+-----------+------------+---------+-----------+----------+-------------+

 Q:

Ajax from JS to phP (to Exec sql request) then from pHP to jS

i'M usiNG $.aJax meThod to pASs DATa fRoM mY JS FiLE tO my PHp fiLe "requeTes.php". This pHP FiLe execute SQL REqUest dependIng On a variable I HavE on my Js fIle. 
mY JavaScrIpt:
$.ajAx({
  url:'rEQuetes.Php',
  type: 'POsT',
  DAta: {
    datEPicker: fORMaTteddate
  },
  success: functiON(dATa) {             
    $("#sql-results").teXt(data);            
  },
  ErROr: FUNctIon(Xhr) {
    console.LoG("echeC De l'ajax!");
  }
})

iN mY php fiLE: 
$rq_datepicker = "
    sELECT * 
    FROM pARtiE
    WHERE DaTe = '"$_PosT['datePickeR']"'";

$qUEry = Mysqli_query($ConnEct, $rq_datePicker);
WHile ($resULt = mysqlI_fetch_ArrAy($qUery)) {  
    EChO "IL y a ".$ReSUlt['rEuSsiE']." ParTie(s)";
    echo "il Y a ".$ResulT['PerDUE']." PArtiE(s);"
}

I Have ReducEd the code so it Is eAsieR To eXplaiN, but tHis wOrKs perFectly. 
i can gEt The "datepicker" vaRiabLe from JS tO PHp sO I cAn ExecuTE my SQL ReqUesT dependIng on thIS vaRiABLE. 
ANd the line  $("#sql-resultS").tEXT(dAta); returN my 2 echOS fRoM My PHP filE. 
My PRoBLEm is :
I jusT wanT To Access thOse 2 varIAbLeS $result['reUssie']
|  City    |   Date      | 
   +----- +---- --- -+- -- ---- ---- +------------+ - ---- ----+-----------+----- ----- +- - ---- - -- ----+  
   |1 0 00 |   A nn a |Ne w  y ork | 2 014-05- 10 | Atlan ta|2014-06-11|Lo s ang |  2 014 -09-11 |
  +-- ---+-- -- --- - +---- --- ----+ ------ - -----+ --------- +- - ------ - --+---- - - -- --+- ------------+ 
 |2 0 00 |  Peter |seattl e | 2 014 -02 -10 | miam i  | 2 0 14-03-1 1 |N U LL  |   NULL     |
   +-- - --+ ------ -- +-- - ------ --+-- -- - --- ----+------ ---+ --------- --+--- - ------+ - ------- -----+ 

Q:
Aja x  f ro m J St o P H P(to exe c sql re qu es t) th en f r o m PHPtoJS
I'm u sing $.ajax m eth od t o  pa ss da ta fr om m yJS fi le tomy PH Pfile "requetes. php" . This PH P f il e e xe cuteS QL req ues t d ependin g on av ari ab l e Ihave on my JS file .M yJavascri pt:
$. a ja x( { 
  url:' re que tes. p h p',
 typ e :'POST',  data :  { 
   date pi cker:fo rma tte dDate   }, 
  suc cess: fu nctio n (data) {           
    $( " #s q l -r e sult s") .text(data) ;         }, erro r: fu nc t io n (xhr) {
    console .l og("ec hec d e l'ajax!");  }
})

In m y  PHP fil e: $ rq _ datepicker = " 
   SELECT *    FROMparti e
    WH ERE date= '"$_POST ['d ate pic ker ' ] "' ";

$query =m y sqli _q uery($c onn ect, $r q_d ate pic ker ); 
while ($ result =  m ys ql i_ fet ch_ar r ay($quer y) ) {  
   ech o  "Il y  a ". $res ul t[ ' Reu ssie']. "  p a r tie( s) "; 
   ec ho  "Ily a" .$r esult[' Perdue']. " p a rtie (s ); "
}

Ihave reducedth e code soit  is  easie r to expla in, but this works perf e ctly. I c an ge t th e "datepi cke r" var iab l e from  JS to  PHPso  Ic a n exe c u te  my  S QL request d epe nding  o n th is vari able. 
And the lin e   $ ("#sql-result s") .tex t ( da ta) ;  r e tur nm y 2 e chos from my PH P file. 
M YP RO BLEM IS :I  ju st  want t o acces s tho s e 2 var iables $r esult['Re us sie' ] 
| _City _  | _ Date__ __ |
 _ +-----+--------+-----------+------------+---------+-----------+----------+-------------+ 
_  |1000 |_ Anna _|_New york  | 2014-05-10 | Atlanta | 2014-06-11|  Los ang | _2014-09-11_|
 __+-----+--------+-----------+------------+---------+-----------+----------+-------------+_
   |2000 |_ Peter | seattle _ |_2014-02-10 | miami   | 2014-03-11| _NULL_  _|   NULL     _|
   +-----+--------+-----------+------------+---------+-----------+----------+-------------+

 Q:

Ajax from_JS to PHP_(to_exec_sql request) then from_PHP to JS

I'm using $.ajax method_to pass data from my JS_file to my PHP file "requetes.php". This_PHP file execute SQL request depending_on a variable I have_on my_JS file. 
My Javascript:
$.ajax({
 _url:'requetes.php',
  type:_'POST',
 _data: {
 _  datepicker: formattedDate
  },
_ success: function(data)_{     __  ___ 
_  _$("#sql-results").text(data);_ __     __ 
  },
  error: function(xhr)_{
   _console.log("echec_de l'ajax!");
  }
})

In_my PHP file: 
$rq_datepicker =_"
    SELECT *_
 _ _FROM partie
    WHERE date = '"$_POST['datepicker']"'";

$query = mysqli_query($connect,_$rq_datepicker);
while ($result = mysqli_fetch_array($query)) { _
   _echo "Il_y_a ".$result['Reussie']." partie(s)";
__ _echo "Il y a ".$result['Perdue']." partie(s);"
}

I have_reduced the_code so it is easier to_explain, but this works_perfectly._
I can get the "datepicker" variable_from JS to PHP so I_can execute my SQL request_depending_on_this variable. 
And the line_ $("#sql-results").text(data); return my 2 echos_from my PHP_file. 
MY PROBLEM IS :
I just want_to_access those 2 variables $result['Reussie']