• Post Reply Bookmark Topic Watch Topic
  • New Topic

database manipulation problem  RSS feed

 
Ravi Harishchandra
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm building a web application for hotel room booking system and facing this problem in updating the room nos.
I have a table (AC) which has a room_no and flag column. When the room is occupied the flag will be set to 1 or else 0. I'm not able to
set the flag when the first room gets filled( i.e Flag of room 1001 = 0);

The code I've used is::
 
Anayonkar Shivalkar
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ravi,

Please UseCodeTags (I've added those for this time).

I'm not exactly sure about your problem. What do you mean by 'not able to set flag'? I don't see any update statement in your code.

Also, what is current value of flag of room 1001? Is it 1 or 0?

Besides this, when flag is 0, you are taking the value of room_no in a variable and breaking the loop (and the variable will go out of scope after that) - any specific reason to do so?
 
Paul Clapham
Sheriff
Posts: 22829
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would go back a step... You haven't said what that code is supposed to do, and I can't even guess what it's supposed to do. And the comments don't help, they are just distracting. So, what exactly is the code supposed to do?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!