Note that there are some explanatory texts on larger screens.

plurals
  1. POChecking if values in Android array exist in MySQL column with PHP, returning records if so
    primarykey
    data
    text
    <p>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 <code>emailAddresses[]</code> and <code>phoneNumbers[]</code> which respectively contain all of the email addresses and phone numbers of the phone's contacts.</p> <p>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.</p> <p>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]","someone@somewhere.com" "email[2]","another@somewhere.com" 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.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload