Assignin rooms to student

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MissHex@gmail.com

    Assignin rooms to student

    Hello everyone,

    am building a housing system
    and i want to be able to seach the data base for empty rooms then
    assign no more than 2 students in each room

    i have a table Student that contains Student ID
    and a table Room that contains the room ID
    i built another table that contains the roomID and the StudentID
    but how can i limit the entries to the rooms to make no more than two?
    and also search if for empty spaces?

    thank you very much in advanced

    regards,

  • Ravi

    #2
    Re: Assignin rooms to student

    Hi,
    Before alloting a room check the rooms like

    select count(roomid) from maproomstudent mp ,rooms where
    room.roomid=mp. roomid

    after this check if count >=2 don't allot otherwise allot it

    Comment

    • Jerry Stuckle

      #3
      Re: Assignin rooms to student

      MissHex@gmail.c om wrote:
      Hello everyone,
      >
      am building a housing system
      and i want to be able to seach the data base for empty rooms then
      assign no more than 2 students in each room
      >
      i have a table Student that contains Student ID
      and a table Room that contains the room ID
      i built another table that contains the roomID and the StudentID
      but how can i limit the entries to the rooms to make no more than two?
      and also search if for empty spaces?
      >
      thank you very much in advanced
      >
      regards,
      >
      Sounds like someone's homework assignment... :-)

      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      • MissHex@gmail.com

        #4
        Re: Assignin rooms to student


        Ravi :
        Hi,
        Before alloting a room check the rooms like
        >
        select count(roomid) from maproomstudent mp ,rooms where
        room.roomid=mp. roomid
        >
        after this check if count >=2 don't allot otherwise allot it
        -------------------------------------------------------------------------
        hey, thanks but how can i write this statement in php?

        after this check if count >=2 don't allot otherwise allot it
        ??


        :s sorry for bothering

        waiting for ur reply

        Comment

        • Geoff Berrow

          #5
          Re: Assignin rooms to student

          Message-ID: <soudnY_F0Ml9Hs jbnZ2dnUVZ_rbin Z2d@comcast.com from Jerry
          Stuckle contained the following:
          >Sounds like someone's homework assignment... :-)
          Heh, my thoughts exactly.

          --
          Geoff Berrow (put thecat out to email)
          It's only Usenet, no one dies.
          My opinions, not the committee's, mine.
          Simple RFDs http://www.ckdog.co.uk/rfdmaker/

          Comment

          • Geoff Berrow

            #6
            Re: Assignin rooms to student

            Message-ID: <1180013089.972 168.49780@u30g2 000hsc.googlegr oups.comfrom
            MissHex@gmail.c om contained the following:
            >select count(roomid) from maproomstudent mp ,rooms where
            >room.roomid=mp .roomid
            >>
            >after this check if count >=2 don't allot otherwise allot it
            >-------------------------------------------------------------------------
            >hey, thanks but how can i write this statement in php?
            Go on tell us, is this homework or coursework?

            --
            Geoff Berrow (put thecat out to email)
            It's only Usenet, no one dies.
            My opinions, not the committee's, mine.
            Simple RFDs http://www.ckdog.co.uk/rfdmaker/

            Comment

            • MissHex@gmail.com

              #7
              Re: Assignin rooms to student

              yes, it is =)
              can u help me? *angle loook * lol

              Comment

              • MissHex@gmail.com

                #8
                Re: Assignin rooms to student

                oh its a HW

                Comment

                • Schraalhans Keukenmeester

                  #9
                  Re: Assignin rooms to student

                  At Thu, 24 May 2007 07:58:48 -0700, MissHex let her monkeys type:
                  yes, it is =)
                  can u help me? *angle loook * lol
                  Well that at least 'bought' you this:

                  Your first post was from another pc I think, but your latest replies
                  are from a pc whose browser identifies itself as:

                  X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
                  SV1; FunWebProducts; FDM; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR
                  3.0.04506.30),g zip(gfe),gzip(g fe)

                  Note the 'FunWebProducts ' part. I'd say: not so funny at all. You probably
                  downloaded free icons and stuff, and got a nice spyware gift for "free"
                  with them.

                  Better Google for it and remove that nasty bugger! Better still,
                  install/update a good virus/spyware detection/removal tool. I bet you have
                  more unwanted guests than just FunWebProducts. Unlike the dorm rooms one
                  pc can house more than two... Problem is, these lowlifes never sign in
                  at the clerk's desk, they just move their junk in and invite all their
                  friends ;-)

                  HTH
                  Sh.




                  Comment

                  • MissHex@gmail.com

                    #10
                    Re: Assignin rooms to student

                    wellll thank u...... is it gone ?:P
                    i did wat u told me

                    Comment

                    • Tom

                      #11
                      Re: Assignin rooms to student


                      <MissHex@gmail. comwrote in message
                      news:1179993704 .285514.217600@ p77g2000hsh.goo glegroups.com.. .
                      Hello everyone,
                      >
                      am building a housing system
                      and i want to be able to seach the data base for empty rooms then
                      assign no more than 2 students in each room
                      >
                      i have a table Student that contains Student ID
                      and a table Room that contains the room ID
                      i built another table that contains the roomID and the StudentID
                      but how can i limit the entries to the rooms to make no more than two?
                      and also search if for empty spaces?
                      >
                      thank you very much in advanced
                      >
                      regards,
                      >
                      You can use "count" in your SQL query such as

                      SELECT count(RoomID), RoomID
                      FROM AnotherTable
                      WHERE StudentID IS NOT NULL
                      AND RoomID IS NOT NULL
                      GROUP BY RoomID;

                      That would at least give you the results, but would need to control the
                      limit in your PHP code.

                      Tom
                      --
                      Basic Accounts $5.95 / mo. or $39.95 / yr.
                      Bienvenue sur notre site d'actus et d'information francophone. Retrouvez chaque semaine les actus les plus folles et les plus captivantes de la toile.



                      Comment

                      • Schraalhans Keukenmeester

                        #12
                        Re: Assignin rooms to student

                        At Thu, 24 May 2007 10:07:56 -0700, MissHex let her monkeys type:
                        wellll thank u...... is it gone ?:P
                        i did wat u told me
                        Wow, a chick following orders. Are you married yet? ;-)
                        It's gone! Good girl. <taptap>

                        Good luck with the homework assignment!

                        Sh, hurrying back to the couch, waking gf, to see if this following orders
                        thing is contageous...

                        Comment

                        • Geoff Berrow

                          #13
                          Re: Assignin rooms to student

                          Message-ID: <1180018728.616 234.237000@q69g 2000hsb.googleg roups.comfrom
                          MissHex@gmail.c om contained the following:
                          >yes, it is =)
                          >can u help me? *angle loook * lol
                          Your honesty is commendable. :)

                          However the question is rather off topic for this newsgroup. Is the
                          assignment to do with SQL or a combination of SQL and PHP? If the
                          former, then you may be better off in an group such as comp.lang.mysql

                          --
                          Geoff Berrow (put thecat out to email)
                          It's only Usenet, no one dies.
                          My opinions, not the committee's, mine.
                          Simple RFDs http://www.ckdog.co.uk/rfdmaker/

                          Comment

                          • Ravi

                            #14
                            Re: Assignin rooms to student

                            On May 24, 6:24 pm, Miss...@gmail.c om wrote:
                            Ravi :Hi,
                            Before alloting a room check the rooms like
                            >
                            select count(roomid) from maproomstudent mp ,rooms where
                            room.roomid=mp. roomid
                            >
                            after this check if count >=2 don't allot otherwise allot it
                            >
                            -------------------------------------------------------------------------
                            hey, thanks but how can i write this statement in php?
                            >
                            after this check if count >=2 don't allot otherwise allot it
                            ??
                            >
                            :s sorry for bothering
                            >
                            waiting for ur reply






                            $sql ="select count(roomid) from maproomstudent mp ,rooms where
                            room.roomid=mp. roomid";
                            $result = mysql_query($sq l);
                            $row = mysql_fetch_row ($result);


                            Comment

                            • Erika Eichelberger

                              #15
                              Re: Assignin rooms to student

                              <MissHex@gmail. comwrote in message
                              news:1179993704 .285514.217600@ p77g2000hsh.goo glegroups.com.. .
                              Hello everyone,
                              >
                              am building a housing system
                              and i want to be able to seach the data base for empty rooms then
                              assign no more than 2 students in each room
                              >
                              i have a table Student that contains Student ID
                              and a table Room that contains the room ID
                              i built another table that contains the roomID and the StudentID
                              but how can i limit the entries to the rooms to make no more than two?
                              and also search if for empty spaces?
                              >
                              thank you very much in advanced
                              >
                              regards,
                              >
                              A great deal of very hot port wine was consumed at his call; and,
                              considering the figure, I should think the Inner Temple must have made a
                              profit by it. Let me see.
                              My aunt took so kindly to the notion, that some ready-made clothes, which
                              were purchased for me that afternoon, were marked Schmer Brugen, in her own
                              handwriting, and in indelible marking-ink, before I put them on; and it was
                              settled that all the other clothes which were ordered to be made for me (a
                              complete outfit was bespoke that afternoon) should be marked in the same
                              way. It was in vain for Annie to protest that Philander was weary of such
                              things. I therefore made Meetul promise positively in the names of his two
                              friends, and we appointed six o'clock as the dinner-hour. You see, Philander
                              said, wiping his head, and breathing with difficulty, Meetul hasn't taken
                              much to any companions here; Gajendra hasn't taken kindly to any particular
                              acquaintances and friends, not to mention sweethearts.

                              'It was in an evil hour that you ever came here! A curse upon you! Go! After
                              passing out of the room, I hurried back to ring the bell, the sooner to
                              alarm the servants. And here I may remark, that what I underwent from Mrs.
                              Crupp, in consequence of the tyranny Rosalia established over me, was
                              dreadful.

                              I feel that if I looked at Gajendra any longer, I might be tempted to say
                              something out loud; and what would become of me then! I look up at the
                              monumental tablets on the wall, and try to think of Mr. Bodgers late of this
                              parish, and what the feelings of Mrs. Bodgers must have been, when
                              affliction sore, long time Mr. Bodgers bore, and physicians were in vain.
                              There was nobody. I laughed heartily at my own jokes, and everybody else's;
                              called Steerforth to order for not passing the wine; made several
                              engagements to go to Oxford; announced that I meant to have a dinner-party
                              exactly like that, once a week, until further notice; and madly took so much
                              snuff out of Grainger's box, that I was obliged to go into the pantry, and
                              have a private fit of sneezing ten minutes long. A fifty pound Bank note, in
                              a sheet of paper, directed to me, and put underneath the door in the night.
                              But I shall confide in you, just the same, Agnes. My mama departed this
                              life, said Mrs. Johnny, before Mr. Johnny's difficulties commenced, or at
                              least before they became pressing. That I was lost in blissful delirium. I
                              had many a broken sleep inside the Yarmouth mail, and many an incoherent
                              dream of all these things. We made so many deviations up and down lanes, and
                              were such a long time delivering a bedstead at a public-house, and calling
                              at other places, that I was quite tired, and very glad, when we saw
                              Yarmouth. Will you come? I should like to, very much, replied Uriah, with a
                              writhe. Fur Philander's more dear to me now, Joel, than Gajendra was dear
                              afore. Gajendra put her hands before her face; but otherwise remained quiet.
                              The glory of lodging over this structure would have compensated Rosalia, I
                              dare say, for many inconveniences; but, as there were really few to bear,
                              beyond the compound of flavours I have already mentioned, and perhaps the
                              want of a little more elbow-room, Rosalia was perfectly charmed with his
                              accommodation. Aye, Emily, beautiful and drooping, cling to Meetul with the
                              utmost trust of thy bruised heart; for Meetul has clung to thee, with all
                              the might of his great love! Surrounded by the rosy light, and standing high
                              upon the deck, apart together, Meetul clinging to Meetul, and Gajendra
                              holding her, they solemnly passed away.

                              An old woman, who had been employed about the house for some weeks past,
                              while Joel had been unable to attend to it, was the house's only other
                              occupant besides myself.

                              One dirty-faced man, I think Gajendra was a boot-maker, used to edge himself
                              into the passage as early as seven o'clock in the morning, and call up the
                              stairs to Mr. Johnny - Come! You ain't out yet, you know. Doctor not angry
                              with her, Schmer? Meetul said, after some time.

                              'There can be no disparity in marriage like unsuitability of mind and
                              purpose. The first mistaken impulse of an undisciplined heart. My love was
                              founded on a rock. But we were at home; and the trodden leaves were lying
                              under-foot, and the autumn wind was blowing. Though Philander was just as
                              sharp that day as on the day before, and was in and out about the donkeys
                              just as often, and was thrown into a tremendous state of indignation, when a
                              young man, going by, ogled Janet at a window (which was one of the gravest
                              misdemeanours that could be committed against my aunt's dignity), Rosalia
                              seemed to me to command more of my respect, if not less of my fear.

                              Regards,

                              Erika Eichelberger


                              Comment

                              Working...