Hello guys, I'm new to the group and to Mojolicious,
I was curious to try it out earlier on and I noticed that when retrieving
data from the db and parsing it to json, the data can assume different
patterns and the elements are not always displayed in the browser with the
same sequence... The key->value relationship is always correct, just the
order of data, data1,data2 changes. Is that normal?
How can that be solved?
The code I use is the following:
my $SQL = "SELECT * FROM Persons WHERE PersonID=$id";
my $cursor = $self->db->prepare($SQL);
$cursor->execute;
my @data = $cursor->fetchrow();
$cursor->finish();
$self->db_disconnect();
return $self->render(json => {data => $data[0], data1=>$data[1], data2=>
$data[2]});
Thank you.
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" 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 https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.