I'm new to PHP and I have been researching how to send and receive data from Android to MySQL using a PHP web layer. I had previously prepared my code to create the Java string arrays emailAddresses[] and phoneNumbers[] which respectively contain all of the email addresses and phone numbers of the phone's contacts.
I want to check each of these values against a MySQL table DATA which contains the fields DATA_TYPE and DATA_CONTENT, which respectively identifies the data as a phone number/email address/other item, and contains the data. I think it best if I load the arrays into PHP and then loop through each of their values to see if a query returns a record. If it does, then I want to build all of the other data in DATA associated to the user with that phone number/email address into a JSON response for Android, which it will later use to copy the data into its own SQLite DB.
I am unsure of how best to handle the input and output for PHP here though. Most examples I see involve setting NameValuePairs as the entity with HTTPPOST, but the examples also seem only to use these as parameters for identifying or copying data from a single record, e.g. for logging in, whereas I want to pass lots of data of the same type (email/phone) for identifying lots of records. I thought it might be a case of specifying the keys as "email[1]","[email protected]" "email[2]","[email protected]" but as I am new to PHP, I wasn't sure how efficient that would be, especially with 100 or so addresses. I'd appreciate some guidance in my new furore, thanks.