Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8854807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:58:09+00:00 2026-06-14T13:58:09+00:00

I have a database which looks like this: Token (PRIMARY) School Skip ————————————– f2342f

  • 0

I have a database which looks like this:

Token (PRIMARY)     School        Skip
--------------------------------------
f2342f              School 1      0
434fbc              School 1      0
33332c              School 1      0

My PHP code sends out a Push Notification to each Token if the School is matched up with a temp database. Then it sets skip to 1, so that it doesn’t try sending another notification for a day.

The problem is though that I can’t have the script set multiple skip values at once. When I do, it seems to work fine for the first token, but then won’t set the skip value for the others, and dies.

Here’s my PHP:

// Run comparison SQL query
        $compare = mysql_resultTo2DAssocArray(mysql_query("SELECT Temp.School, Temp.Status, Snow.Skip, GROUP_CONCAT(Snow.Token SEPARATOR '\', \'') Tokens FROM Temp JOIN Snow USING (School) WHERE Skip = 0 GROUP BY Temp.School"), $con);
        $amount = count($compare);

        // Send Push Notifications
        for ($i = 0; $i < $amount; $i++) {
            $message = $compare[$i][School] . " - " . $compare[$i][Status];
            $tokens = $compare[$i][Tokens];
            pwCall( 'createMessage', array(
                'application' => PW_APPLICATION,
                'username' => PW_LOGIN,
                'password' => PW_PASSWORD,
                'notifications' => array(
                    array(
                        'send_date' => 'now',
                        'content' => $message,
                        'ios_badges' => 1,
                        'ios_sound' => 'bells.caf',
                        'data' => 'daily',
                        'devices' => array($tokens),
                        )
                    )
                )
            );
            if (!mysql_query("UPDATE Snow SET Skip='1' WHERE Token='$tokens[$i]'", $con)) {

                echo "<pre>";
                print_r(str_replace("'", '', $tokens));
                echo "</pre>";

                die('Error: ' . mysql_error());
            }
        }

With the output being:

f2342f, 434fbc, 33332c Error: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the
right syntax to use near ‘ ‘f2342f’, ‘434’ at line 1

So to me it seems that I need to have it set the skip recursively, unless I’m missing something important with my code.

$compare:

Array
(
    [0] => Array
        (
            [School] => School 1
            [Status] => Closed 
            [Skip] => 0
            [Tokens] => f2342f', '434fbc', '33332c
        )

)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T13:58:10+00:00Added an answer on June 14, 2026 at 1:58 pm

    After you do this:

    $tokens = $compare[$i]['Tokens'];
    

    $tokens should be something like this:

    f2342f', '434fbc', '33332c
    

    Meaning your query should be changed to

    "UPDATE Snow SET Skip='1' WHERE Token IN('$tokens')"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a field called system in my database which looks like this system
I have a database which contains an Assignment table. The table looks like this:
I have a database table looks like this: EVENT_ID TEXT_FRO TEXT_TO 55001 05 55001
I have a database in MYSQL and it has chat table which looks like
In my code I have several lines of code which looks like this: Insertions[sale]
I have a legacy SQL schema which looks something like this: CREATE TABLE `User`
I have a String which looks like this NSString *string = @2012-04-30T23:59:00+10:00; Right now,
I have a Table which looks like this: --------------------------- |housing_id | facility_id | ---------------------------
I have table consisting of notes for every user which looks like this: user_id
I have a file data.base which looks like: 1234 XXXX 4321 XXXX 9884 ZZZZ

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.