php - how receiving double-digit instead single-digit using $.each function -
I have solved the problem getting data from mysql, they will appear in the form (23,34,65,67 ..atc), but using a $ .eec () function showed a new problem, I get only one digit number 2,3,3,4, instead of 23,34 ... etc, I get How to slice data on two digit figures using the $ .each () function
$ ("# add"). Click (function () {$ .ajax ({type: "POST", Url: "ajax.php", data: "button =" + tab_of_button, success: work () {$ ('div.success'). FadeIn (); $ .get ("sendback.php", function (data) {$ .each (data, function (index, value) {warning (value);})}}};}}); return back; }
sendback.php
& lt ;? Php $ ask = mysql_query ("Select numbers from buttons"); If (ask $!) {Die ('ask incorrect'. Msql_ar ());} other {while ($ row = mysql_fetch_assoc ($ ask)) {$ tab [] = $ line ['number']; foreign currency $ Tab $ button) {$ button;}} Mysql_free_result ($ ask);}? & Gt;
html
& lt; html & gt; & lt; body & gt; & lt; ulid = "_boot"> 01 <03 li id =" 04 "> 04
You should correct the output of your php file. If it lets you string (numbers), then you can parse only one thing on the client, each character as a separate, or complete string.
This gives you a Jason array, so that you get every element on the customer.
$ tab = array (); While ($ line = mysql_fetch_assoc ($ ask)) {$ tab [] = $ line ['number']; } Echo json_encode ($ tab);
Comments
Post a Comment