Thanks a lot Sander !
Unfortunately I can't change how the database is made , but maybe I can
change my SQL request ?
(I'm also kinda new to sql ^^")
so i've done this two SQL request :
$sql1 =' SELECT * FROM Tasklist INNER JOIN GenericTask ON
> Tasklist.GenericName = GenericTask.GenericTaskID WHERE Tasklist.TaskID =
> \'' . $_GET['TaskID'] . '\' ' ;
> $sql2 ='SELECT * FROM Procedures WHERE Procedures.Taskref = \'' .
> $_GET['TaskID'] . '\'
> $json = json_encode(array_merge($result, $result2));
> echo $json
That I, then merge before encoding it in JSON : maybe I can do something
better than just merge them ?
Or can I change how $sql2 is retrieve to be in a better format ?
Though, I'm afraid that's not possible ? For parsing the data , I also
thought about that , but I have no clue on how to even begin to do that ?
(Can you give me a hint ? )
Thanks a lot !
On Thursday, 25 June 2015 17:47:20 UTC+2, Sander Elias wrote:
>
> Hi Vladimir,
>
> This is not an angular issue at all. The way the server returns it data is
> a bit off. The easiest/best solution is that the server returns the data in
> a more sane format!
> Is this at all possible? If not, you need to parse the object client side.
> Not that difficult, but a bit annoying.
> Tell me if I can help you there a bit.
> you need something like this:
> {
> "ActionID": "1",
> "Taskref": "1",
> "Ast1": ["","Egress cabin to LM porch\nReceive & jetttison
> bag\nReceive ETB/LEC","Descend lander to top rung\nUnlock and deploy
> MESA\nLower ETB on LEC]
> "Ast2": ["Start EVA watch\nopen hatch\nAssist CDR", "
> Egress cabin to LM porch\nReceive & jetttison bag\nReceive ETB/LEC
> ",""]
> "Ast3": ["","Deploy CDR PLSS antenna\nHand jettison bag to
> CDR\nHand ETB/LEC to CDR",""]
> }
>
> or even better/ easier to use:
> {
> "ActionID": "1",
> "Taskref": "1",
> disc: : [
> {
> ast1: "lin1"
> ast2: "lin1"
> ast3: "lin1"
> },{
> ast1: "lin2"
> ast2: "lin2"
> ast3: "lin2"
> }
> ]
> }
>
> Does that makes some sense to you?
>
> If the server can not provide that, you need to parse into that yourself.
>
> Regards
> Sander
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" 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/angular.
For more options, visit https://groups.google.com/d/optout.