Your while loop should look like this:
while($row = mysql_fetch_array($result)) {
$temp = array();
$temp['DisplayText'] = $row['nombre_escolaridad'];
$temp['Value'] = $row['id_escolaridad'];
$rows[] = $temp;
}
On Wednesday, May 1, 2013 7:03:39 AM UTC-4, Chrystopher Medina wrote:
>
> my friend i think that i have found the answer to my problem. but could
> you help me to generate the next format json whit php
>
> i have this
>
> <?php
>
> $con = mysql_connect("localhost","root","chrystopher");
> mysql_select_db("si_caoi", $con);
>
> $result = mysql_query("SELECT * FROM escolaridad;");
>
>
> $rows = array();
> while($row = mysql_fetch_array($result))
> {
> $rows[] = $row;
> }
>
>
> $ff = array();
> $ff['Result'] = "OK";
> $ff['Options'] = $rows;
> print json_encode($ff);
>
> ?>
>
> and this the result in json:
>
>
>
> {"Result":"OK","Options":[{"0":"2","id_escolaridad":"2","1":"Secundaria","nombre_escolaridad":"Secundaria"},{"0":"3","id_escolaridad":"3","1":"Preparatoria","nombre_escolaridad":"Preparatoria"},{"0":"4","id_escolaridad":"4","1":"Licanciatura","nombre_escolaridad":"Licanciatura"},{"0":"5","id_escolaridad":"5","1":"Maestria","nombre_escolaridad":"Maestria"},{"0":"6","id_escolaridad":"6","1":"primaria","nombre_escolaridad":"primaria"},{"0":"8","id_escolaridad":"8","1":"uj","nombre_escolaridad":"uj"}]}
>
>
> and what i wanna obtain is the next format json
>
> {
> "Result":"OK",
> "Options":[
> {
> "DisplayText":"Secundaria",
> "Value":"2"
> },
> {
> "DisplayText":"Preparatoria",
> "Value":"3"
> },
> {
> "DisplayText":"Licenciatura",
> "Value":"4"
> },
> {
> "DisplayText":"Maestria",
> "Value":"5"
> },
> {
> "DisplayText":"Primaria",
> "Value":"6"
> },
> {
> "DisplayText":"uj",
> "Value":"8"
> }
> ]
> }
>
>
>
> 2013/5/1 Chrystopher Medina <[email protected] <javascript:>>
>
> my frined have u ever used this plugin named jtable ...
> please check this http://www.jtable.org/Demo/Filtering i just wanna
> filtering but with php and in that example is in asp.net could you helme
> please. there is not documentation about how to use it on php.
> please my friend
>
>
> 2013/4/24 Chrystopher Medina <[email protected] <javascript:>>
>
> i found the problem my friend i think that it was because linux is
> sensitive to case sensitive
>
>
> 2013/4/23 Chrystopher Medina <[email protected] <javascript:>>
>
> its a plugin to do crud aplications but it does not work on linux my
> friend ... u know why
>
>
> 2013/4/23 Chrystopher Medina <[email protected] <javascript:>>
>
> my friend i have the next file but this is not loaded on linux u know why.
> because i downloaded a example from jtable.orj but i tried it on windows
> and everything looks perfectly but on linux nothing
>
>
> 2013/4/23 Chrystopher Medina <[email protected] <javascript:>>
>
> Thanks my friend
> El 23/04/2013 10:59, "asgallant" <[email protected] <javascript:>>
> escribió:
>
> You can use that. The license is described here:
> https://jquery.org/license/
>
> On Tuesday, April 23, 2013 12:56:06 AM UTC-4, Chrystopher Medina wrote:
>
> my friend i found a plugin to do crud aplications . but it contains this
>
>
> * jQuery UI Sel
>
> ...
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.