A class which represents an SQL table I'm representing DB tables as classes (in this case PHP classes). This has the goal of modeling every section of the web page, where you will get inputs from the user.

My actual base design is:


One class per table and every row is represented by an Object of this class. 
The constructors asks for what they need in order to get the table row which they will represent:

info = $this->getRowFromVideos($id); 
    }
}


The way I access the DB is not important here.

Every field of the table is stored as an array in an $info variable. And I have a method to access for the whole row or just a field.

    function getInfo($key = false){
        if($key) return $this-&gt;info[$key];
        else return $this-&gt;info;
    }


For composed tables like Players who needs an User and a Game ID, the query would be like this:

SELECT * FROM players WHERE userID = 'xxxxxx' AND gameID = 'SC2'


And the constructor class asks for an User object and Game object:

class Player extends DB {
    private $info = array();
    private $user;
    private $game;

    public function __construct($user, $game){
        $this-&gt;user = $user;
        $this-&gt;game = $game;
        $this-&gt;info = 
              $this-&gt;getRowFromPlayers($user-&gt;getInfo("userID"),$game-&gt;getInfo("gameID")); 
    }
}


Of course, these classes are not designed to satisfy CRUD needs, like inserting a new user or deleting a video. Those responsibilities would be encapsulated in other classes.

I cannot see which problems may appear with this design in the future if the web page gets really big.
Take a look at
Object Relational Mapping,
especially
Object-relational impedance mismatch
on Wikipedia.

Basically there problems with this as soon as it gets a bit more
complicated and you need to query e.g. a lot of objects at once, or you
have joins, and so on.

Let's take $this-&gt;getRowFromPlayers.  I'm assuming, that that method
will fetch one row from the database.  So you already have a
bottleneck here because you'll have to run n separate queries for
each of your n IDs when you want to get like a list of objects by
their IDs, which is very inefficient.  So you'll have to construct
objects from the outside, mapping a result of multiple rows from the
database to newly constructed (or cached) objects.

Another problem often comes up in that your objects don't exactly are
the table rows, they are just mapped onto objects, so testing by
identity is mostly meaningless unless you keep track of objects and
return the same object for the same row of a table.  It gets complicated
very fast.

Obviously there are already solutions for this, so I suggest you take a
look at existing PHP libraries for this.