RPG- Moving System

Please refer to the image attached, I’m looking how to do this with PHP/MySQL., you don’t have to feed me code; a general idea of how to do will do. You’re able to move through these rooms, I’m thinking that in the databse (named “rooms”) I’ll have a field that says its available directions. A sample output of this database would be like:
ID: 3
Occupants: Dan,Steve
Paths: U,D

So this would be room 3, inside of room three lie Dan and Steve (players, I’m contemplating whether or not to have a seperate field for NPCs) They are able to move Up or Down from room 3.