Php - Range of numbers 1 -> 20... I want to determine and list the unused numbers

Discussion in 'PHP' started by workingsmart, Jul 20, 2012.

  1. #1
    Numbers 1 through 20. I have items in the database that use some of these numbers. When I get the numbers from the database - I want to compare them to the list of 1 - 20 and print the ones that aren't used.

    For some reason - my brain is not letting me see the solution.

    could be that I'm going on 20 hours with no sleep... lol...

    Any help would be appreciated... So I can finish this and go to bed... :)
     
    Solved! View solution.
    workingsmart, Jul 20, 2012 IP
  2. #2
    Just set the numbers to an array, and loop the db and check the looped against the array value and store into a string the numbers that don't match.
     
    HuggyEssex, Jul 20, 2012 IP
    workingsmart likes this.
  3. workingsmart

    workingsmart Well-Known Member

    Messages:
    411
    Likes Received:
    12
    Best Answers:
    9
    Trophy Points:
    120
    #3
    Duh! Thanks!! - Total Brain fart...
     
    workingsmart, Jul 20, 2012 IP