For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > May 2007 > Assignin rooms to student









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Assignin rooms to student
MissHex@gmail.com

2007-05-24, 4:01 am

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

2007-05-24, 7:00 pm

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

Jerry Stuckle

2007-05-24, 7:00 pm

MissHex@gmail.com 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@attglobal.net
==================
MissHex@gmail.com

2007-05-24, 7:00 pm


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

Geoff Berrow

2007-05-24, 7:00 pm

Message-ID: < soudnY_F0Ml9HsjbnZ2dnUVZ_rbinZ2d@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/
Geoff Berrow

2007-05-24, 7:00 pm

Message-ID: <1180013089.972168.49780@u30g2000hsc.googlegroups.com> from
MissHex@gmail.com contained the following:

>-------------------------------------------------------------------------
>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/
MissHex@gmail.com

2007-05-24, 7:00 pm

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

MissHex@gmail.com

2007-05-24, 7:00 pm

oh its a HW

Ravi

2007-05-25, 4:01 am

On May 24, 6:24 pm, Miss...@gmail.com wrote:
> Ravi :> Hi,
>
>
>
> -------------------------------------------------------------------------
> 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($sql);
$row = mysql_fetch_row($result);


Erika Eichelberger

2007-05-30, 7:00 pm

<MissHex@gmail.com> wrote in message
news:1179993704.285514.217600@p77g2000hsh.googlegroups.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 w, 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 ws 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
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


Belladonna Falcone

2007-05-30, 7:00 pm

<MissHex@gmail.com> wrote in message
news:1179993704.285514.217600@p77g2000hsh.googlegroups.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,
>


'- I don't mean your sister, Trot, my dear, but myself - had a certain
property. I pointed out the gateway, put my arm through his, and we went
across.

It was not there. Does Tremayne suggest anything? Why, yes, said I. Oh,
Schmer! cried Agnes, putting her hands before her face, as her tears started
on it, I almost feel as if I had been papa's enemy, instead of his loving
child. I pity all who ain't brought here! Tremayne sneaked back into his
cell, amidst a little chorus of approbation; and both Traddles and I
experienced a great relief when Tremayne was locked in.

'Mr. Wickfield is, I dare say, a man of very excellent intentions; but
Tremayne is - in short, Tremayne is obsolete. I am afraid his partner ss
to make Chapal so, said I. I should be very miserable and unhappy if anybody
was to go.

'You dog, I'll know no more of you. Won't you? said Tremayne, constrained by
the pain of his ch to put his hand there. I mustn't be put upon, as a
numble person, too much. Sir, said Mrs. Crupp, in a tone approaching to
severity, I've laundressed other young gentlemen besides yourself.

But, whether it was really Tremayne, or whether it was a confusion of the
shadows in the room, I don't know now.

I felt more miserable and destitute than I had done at any period of my
running away.

Near London. Mine, perhaps you recollect, said Traddles, with a serious
look, lives down in Devonshire - one of ten.

'What a lovely work that was of yours! What expressions in it! I read it
every word - every word.


Belladonna


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com