5 Replies - 728 Views - Last Post: 12 September 2008 - 03:58 AM Rate Topic: -----

#1 Jonson  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 40
  • Joined: 17-April 08

One Button Create Multiple Rooms. How?

Posted 07 September 2008 - 11:10 PM

I am using SQL SERVER 2005 as my database. I use web services to pass data and get data. I have a problem like how do i create multiple rooms with just one button? i have an idea:

like
if(Room1 Exist)
{
Create TABLE Room2..etc
}
else if (Room1 Exist AND ROOM2 Exist)
{
CREATE TABLE Room3..etc
}


Any help is appreciated. thx. I am using Flash As3.

** Edit ** :code:

Is This A Good Question/Topic? 0
  • +

Replies To: One Button Create Multiple Rooms. How?

#2 dineeshd  Icon User is offline

  • member icon

Reputation: 38
  • View blog
  • Posts: 619
  • Joined: 30-June 08

Re: One Button Create Multiple Rooms. How?

Posted 08 September 2008 - 02:20 AM

Why you are creating separate tables for each room, why can't you use same table for all rooms with unique room ids...
Was This Post Helpful? 0
  • +
  • -

#3 xerxes333  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 31
  • View blog
  • Posts: 504
  • Joined: 05-July 07

Re: One Button Create Multiple Rooms. How?

Posted 08 September 2008 - 05:22 AM

View Postdineeshd, on 8 Sep, 2008 - 02:20 AM, said:

Why you are creating separate tables for each room, why can't you use same table for all rooms with unique room ids...


I agree with dineeshd, why would you want multiple "room" tables, unless you are going to be storing copious amounts of data in the tables they are going to be very inefficient.
Was This Post Helpful? 0
  • +
  • -

#4 Trogdor  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 15
  • View blog
  • Posts: 627
  • Joined: 06-October 06

Re: One Button Create Multiple Rooms. How?

Posted 08 September 2008 - 10:34 AM

to do what you want:
if(Room1 Exist)
{
   Create TABLE Room2..etc
}

if (Room1 Exist AND ROOM2 Exist)
{
	CREATE TABLE Room3..etc
}


Just ditch the else.
However, why would you create a table in flash?
inserting a record, okay, but creating a table?
Was This Post Helpful? 0
  • +
  • -

#5 Jonson  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 40
  • Joined: 17-April 08

Re: One Button Create Multiple Rooms. How?

Posted 08 September 2008 - 08:09 PM

Ok, let me show u all my project developer pictures, u will understand upon looking at it. As u can see, i have 6 borders to show the rooms that are created, and one CREATE button. THis create button will create roomS. Each room will have each unique table to store their X and Y coordinates for the Game Pieces.
Posted Image

AFTER CREATING A ROOM:
Posted Image

i would greatly appreciate anyone's help. Thanks.
Was This Post Helpful? 0
  • +
  • -

#6 Trogdor  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 15
  • View blog
  • Posts: 627
  • Joined: 06-October 06

Re: One Button Create Multiple Rooms. How?

Posted 12 September 2008 - 03:58 AM

create 1 table with rooms. each room is one reccord, and has a room-id.
create 1 table with pieces, each piece is one reccord, containg all needed piece data (like coordinates) AND a room-id.
By putting the room-id in the where clause you can do all operations for one room on that table.

You do not need to create tables on the fly. It just leads to problems.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1