tags:

views:

16

answers:

0

I'm looking to put together a php script that allows me to enter a custom message that would be sent to all registered user of my iPhone app.

My SQL database contains all of the pushID (aka Tokens) and I would call them by this code:

mysql_query("SELECT cPushID FROM tblUsers WHERE Length(cPushID) > 70 AND cAlerts = 'All' AND cPreferences LIKE '%$cat%';");

I have the proper code setup to push notifications at a certain event (works perfectly for our app).

$payload['aps'] = array('alert' => "A new question has been posted", 'badge' => 0, 'sound' => 'default');

Essentially, I want to change the hard coded message to a variable, say $msg, that is retrieved from a form.

Hoping to be pointed in the right direction. Thanks very much! If it helps to see the entire code, just let me know.