CloudMQTT / php-mqtt-example

Sample app which publish and subscribe to/from a CloudMQTT broker
https://www.cloudmqtt.com
16 stars 8 forks source link

action based on paylod #3

Open pw44 opened 3 years ago

pw44 commented 3 years ago

by subscribe.php, function procmsg($topic, $msg){ echo "Msg Recieved: $msg\n"; } shows the paylod ($msg).

How to include a database query using the paylod ($msg)?

as i understand, procmsg is called inside while($mqtt->proc()) {}.

thx in advance in explaining how it can be done.