Jump to content

Whats the best way?


hoponhiggo

Recommended Posts

Hi Guys

 

I am new to web design, php, mysql and pretty much everything else that comes with it!

 

I have a (very big and ultimatly very challanging) project idea, but im not quite sure where to start. I have decided to break it down into sections and concentrate on one section at a time.

 

The next section, which is the one i need advice for now, is a game review page. The problem is, i havent got a clue on the best route to go down and where to start. I have an idea in my head, but getting it down on to a webpage is going to tricky.

 

Here goes...

 

What i am after is a page with a list of all the games, including artwork and a brief description. A session user can then click on that game and it will open in a new page with the game details at the top of the page. The user can then give it either a 'Thumbs Up' or a 'Thumbs Down' and choose to write a comment about the game.

 

Now for the extra tricky part...This rating and review should be displayed beneath the game info in TWO columns. Column one should be a GLOBAL rating ( a total of all ratings). Column two should be a friends only rating (my friends system is currently in development).

 

Given the above requirements, i know this would be a vast combination of HTML, PHP and MySQL, im just not certain which bits i would use for which.

 

Can anybody please provide advice or suggestions on where to start, or even offer help and and support through this challenge?

 

I would be gratefull for any input.

 

Thanks

 

Hoponhiggo

Link to comment
Share on other sites

hehehe, you broke your project horizontally, you actually have to break it vertically, the layer thing called MVC may be a good line to follow

 

well... first you gotta connect to the database (create a class that manages connections and executes queries so that when you change your database you have to modify only a single file)

then you have to either use the connection class directly on the page to fetch and display data on your screen or create a Beam class that will navigate the registries and have gets and sets

 

 

 

What I did in a project of mine is creating an abstract class Beam with save, erase, next, prev, first, last, find etc using protected atributes like table and key to do the navigation, then inherit from it, sets the properties you need in the constructor and implement the gets and sets for that 'table representation class' (aka Beam)

 

when you get that model layer of MVC you can then do something like:

    $articles = new Articles();
    $articles->find(); //empty for all
    while($articles->next()){
        echo $articles->getTitle();
    }

 

but that's just me, I'm sure the others will have other methods of doing it

 

 

Link to comment
Share on other sites

Thanks for your comments, but like i said, im kind of a begginer so alot of this has gone straight over my head haha

 

Could you just clarify a few points...?

 

what does this mean

 

you broke your project horizontally, you actually have to break it vertically, the layer thing called MVC may be a good line to follow

 

and then pretty much the rest of the post coming to think of it!

 

 

Link to comment
Share on other sites

He's saying that non-trivial websites are built in layers/tiers.  The MVC (short for Model-View-Controller) pattern represents a particular kind of layered app.  The most general idea is that your data is represented, in script, as Models, the View(s) is/are what the user sees as a web page, and the Controller(s) are the brains of the operation.  By breaking a site up into these components, you can easily expand or modify the site itself, as each layer communicates with the others through limited and clear lines of communication.

 

Most PHP frameworks implement the MVC pattern.  That said, you can fudge it on your own by adhering to Separation of Concerns and having an idea of what each layer should do.

Link to comment
Share on other sites

Ok Thanks for the clarification. It looks like i got a big job and a lot of learning to do haha.

 

Im gonna start by doing a little more research, but my current line of thinking is to design a 'gamecards.php' which will be a form that is populated with records from the database.

 

This form can then be included in 'gamereview.php' as a layer?

Link to comment
Share on other sites

Again, generally speaking, things are normally done like:

 

HTTP request is made to the server.

Request is handled by a front controller which parses the request and retrieves the correct MVC controller.

MVC controller loads the appropriate view, populated with model data if necessary.

 

Form processing normally happens in a controller.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.