Help me please to fix this stuck code

Dear all, i want add this flow to php code ,

send user notification with selected category, example =

USER A select CATEGORY A,B then other USER B post item to CATEGORY C, i want user A not recieve notification. USER A only recieve notification only from post CATEGORY A and B.

Are you asking somebody to write the code for you? I’m not sure you will get much response here if that’s the case. But if you try to have a go at it yourself and get stuck, post your code and people will be glad to help you out.

What kind of experience do you have with PHP?

forget it, this my table =

uid | email | gcm_id | app_type | categories

 1    demo@gmail.com xzxzxzxz    A           2,5,6

`the code :

if (!empty($cat)) {
        foreach ($cat as $key => $value) {
            $wc.="FIND_IN_SET('$value',categories) > 0 OR ";
        }
    }

    $pos = strrpos($wc, "OR");

    if ($pos !== false) {
        $wc = substr_replace($wc, "AND", $pos, strlen("OR"));
    }

    $wc.=" is_active=1";


    $q = "select * from datanotif where app_type='$type' AND $wc ";

  
    $r = mysqli_query($mysqli,$q);
    $users = array();
    while ($row1 = mysqli_fetch_assoc($r)) {
        $users[] = $row1;
    }
    
    $ids = array();
foreach ($users as $key => $value) {
    $ids[] = $value['gcm_id'];
}`

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.