hoponhiggo Posted June 21, 2011 Share Posted June 21, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/239966-whats-the-best-way/ Share on other sites More sharing options...
hoponhiggo Posted June 21, 2011 Author Share Posted June 21, 2011 For reference, i have attached a mock up of how i would like the first page to look... [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/239966-whats-the-best-way/#findComment-1232730 Share on other sites More sharing options...
SparK_BR Posted June 21, 2011 Share Posted June 21, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/239966-whats-the-best-way/#findComment-1232748 Share on other sites More sharing options...
hoponhiggo Posted June 21, 2011 Author Share Posted June 21, 2011 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! Quote Link to comment https://forums.phpfreaks.com/topic/239966-whats-the-best-way/#findComment-1233001 Share on other sites More sharing options...
KevinM1 Posted June 21, 2011 Share Posted June 21, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/239966-whats-the-best-way/#findComment-1233027 Share on other sites More sharing options...
hoponhiggo Posted June 22, 2011 Author Share Posted June 22, 2011 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? Quote Link to comment https://forums.phpfreaks.com/topic/239966-whats-the-best-way/#findComment-1233195 Share on other sites More sharing options...
KevinM1 Posted June 22, 2011 Share Posted June 22, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/239966-whats-the-best-way/#findComment-1233335 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.