I know this is a loaded question, but I think what I'm doing right now is probably the wrong way to go about things, so I'd like some input as to what is best practice.
Currently I have an array of actors. Let's say NSArray *actors
in Objective-C. I want to pass this up to my PHP page for storage.
Right now I pass this up on HTTP POST
by turning the array into a string such as this:
&actors=Joe Allen*Dave Smith*Mary Johnson*Alice Burg?movietitle=Runner
When it gets to PHP I'm then passing it to MySQL via a Stored Procedure call like this:
CALL Add_Movie(movietitle, actors);
And then in my sproc is where I 'explode' the actors by *
to save them in the correct table. I do the reverse to get the actors back. It's gotten even trickier for me when I've wanted to separate first/last names.
Anyway, this seems really hacky to me. What's best practice for an array transfer over HTTP to SQL storage and back?