   [web] A PBBG from scratch
  Hi all,I'm undertaking a huge project with little knowledge about programming. But a couple of months ago i had slim to no experience and with the little time i had i have build my login and registration form with css, html, php and mysql.So now the actual work starts, i "know" how to write from php to mysql and to look up information inside the database and put them into variables. I will be writing down this huge list of variables i need as well as the database structure in a Entity Relation Diagram. So i can keep track of things. But before i do that i want to start smaller for testing, just a character with some equip slots, a shop to buy different weapons/armor, and a battleground. I can probably pull this off and will be starting this in the coming days.So i think i know how to pull that off but just text based. I'd like to know what i NEED to know to make it more graphical. Are there specific guides/tutorial for this? Can this be done with the help of CSS? Like inside a div i can do a database query for the correct background image location? Or am i totaly off track :D? Let's say i want in my top left view the icon (that i have drawn) of my currently equiped weapon.And for last, is the way i'm approaching this project right? Like making a Entity Relation Diagram and a list of variables before i get into other things. Should i focus after this on code or on design or should my design already be finished? Any other things i should do before i'm stuck in the middle? :DAlso, i hope this community can help me out where needed. This has been a childhood dream and i tend to make it happen, it might take 20 years but i don't care as long as i learn something :D.Thanks!   
Quote:Original post by menyoSo i think i know how to pull that off but just text based. I'd like to know what i NEED to know to make it more graphical. Are there specific guides/tutorial for this? Can this be done with the help of CSS? Like inside a div i can do a database query for the correct background image location? Or am i totaly off track :D? Let's say i want in my top left view the icon (that i have drawn) of my currently equiped weapon.A div is just a layout element, you don't run code in it. I assume you already know how to query information from a database? You can use that to generate the required HTML (or CSS, or &#106avascript) to display an image. You could store image within a database as a binary blob if that's what you were hinting at, but it's much easier to just have them on disk.Quote:And for last, is the way i'm approaching this project right? Like making a Entity Relation Diagram and a list of variables before i get into other things.Listing all your variables might be a it much, but do whatever helps you in your work. I personally only sketch the bigger picture or specific complex problems. You can't plan everything in advance.Quote:Should i focus after this on code or on design or should my design already be finished? Any other things i should do before i'm stuck in the middle?I would do both, more or less at the same time: you can easily encounter problems during implementation that require you to change your initial design.;Quote:Original post by WanA div is just a layout element, you don't run code in it. I assume you already know how to query information from a database? You can use that to generate the required HTML (or CSS, or &#106avascript) to display an image. You could store image within a database as a binary blob if that's what you were hinting at, but it's much easier to just have them on disk.I guess i need to know more about this. Let's say i have the images on my disc. So for each item, skill, etc i need to put in a url to that image and HTML/CSS code inside the database? Now i can put that information inside a variable but how would i get that information inside the html/css? Where can i find some more information about this? Or a simplified tutorial of how i would go about building up a HTML/CSS page from a database query.Regards, Menno;Quote:Original post by menyo...i have build my login and registration form with css, html, php and mysql...Quote:Original post by menyo...i need to put in a url to that image inside the database? ... i can put that inside a variable but how would i get that information inside the html/css?...Where can i find a simplified tutorial of how i would go about building up a HTML/CSS page from a database query? Are you sure you understood the tutorial what you had done when you "created your login and registration page with HTML, PHP and MySQL"?Or did you just copy'n pasted the source from some tutorial and thought that you are ready now for "the next big thing", without really understanding what you did?I think you should redo all tutorials you already did, and then you can answer the question yourself....Maybe i misunderstood you, but if you just don't know how to update HTML already displayed in the users browser. You can't*! The user has to reload your page, so you can build the new HTML layout and the CSS linked image on the fly with PHP at the server before sending the result to the user.* ("you can't" means you can't without proper knowledge of &#106avascript)   ;  I knew i would get replies like this which are assuming all kinda things and are not helpfull at all. Did you actually read through my whole post? If you did you would have seen that i did more research then just copy and paste code. I am used to the very helpful forums of 3D design so i'm sorry if this is standard policy for programming forums.Though you are partly correct, i followed a tutorial and no i don't understand ALL of it yet, but most of it. Also i won't be able to write all of the code out of my head, but programming is all about having reference nearby. I never said i was ready for the next big thing but that i might be ready for the next step wich would be a "small" test environment that involves a character, shop, fight "text based".In the tutorial i did, everything except (obviously :D) the forms where HTML. The rest was PHP. And like i said i know how to request from and write to the database. Also i have learned how to use that data inside PHP, like doing some math on some numbers or echo out someones name.But it didn't explain how to put in HTML/CSS code inside the database and calling that out within HTML.Let's say i have a table "weapons" with these fields:iditemnamedamageimagelocationhtmlcodeNow with the knowledge i have i can put this inside a variable. But how do i get the information in this variable inside my HTML and CSS file, i mean i can't call this variable inside my stylesheet right?Look i'm not asking anyone to write down the code i need, i just need some direction on this particular subject. A tutorial that covers the basics of using html/css from inside MySql would be helpful. The solution might be very obvious to you, and even be really simple and i'm just looking over it but i'm just a new guy trying to learn.   ;  Lol would it really be this simple?Make a variable called $code where i put down the code and simply echoing this variable out within the body would actually work?<html><head><body><?php echo $code;?></body></html>If it's as simple as this. Can i call out a variable inside a div. Let's say i have a UI and i just want to change that weapon in the top left corner. Where the image goes inside html can i just say :<?php echo '';?>or if i have the images location stored inside the database and put that into variable $image<?php echo $image;?>orIs it really this simple? Well it's not that simple if i want to integrate this into a complete UI but atleast i know how to if this is the correct approach :D.-edit-How can i turn of HTML code so you can see my raw code i just typed?   ;Quote:Original post by menyo...How can i turn of HTML code so you can see my raw code i just typed?...Use [ source]your text here[/source]Quote:Original post by menyo...Lol would it really be this simple?......Is it really this simple?...Yes it is. And thats the way to go. (And it was my intention to point you to that with the last paragraph of my other post)<?php$image = "image.jpg"; // fetch name from databaseecho("<img src=\"$image\""); // output HTML with image url?>further hints:- you don't have to store HTML syntax in the database, the image file path should be enough (otherwise that HTML part is redundant for every row in your table)- like i already said, you can't update HTML on the client-side; the user has to reload it's page(But you can, if you know &#106avascript which will let you manipulate HTML at the client. Thats possible because &#106avascript gets executed by the clients browser, not like PHP is by your server)<br><br><br><!--QUOTE--><BLOCKQUOTE><span class="smallfont">Quote:</span><table border=0 cellpadding=4 cellspacing=0 width="95%"><tr><td class=quote><!--/QUOTE--><!--STARTQUOTE--><i>Original post by menyo</i><br>...A tutorial that covers the basics of using html/css from inside MySql would be helpful...<!--QUOTE--></td></tr></table></BLOCKQUOTE><!--/QUOTE--><!--ENDQUOTE--><br>Don't intermingle HTML with MySQL, that are totally different things. And they can't be composed in a way like you think.<br>- Whenever you want data coming from a database like MySQL displayed by a description language like HTML, you need something inbetween. With the help of a programming language like PHP, which will fetch the data for you and builds the right HTML out of it, you are ready to go.<br>- And for the other way around. MySQL don't know HTML. HTML is just plain text for MySQL, which stores plain text as character data like any other database. So you will not find a tutorial which covers "using HTML from inside MySQL", but you will find something like "retrieving text from a database", which in turn can be interpreted as HTML by your intermediate programming language.<br><br><br>edit:<br>and &#111;ne last thing<br><!--QUOTE--><BLOCKQUOTE><span class="smallfont">Quote:</span><table border=0 cellpadding=4 cellspacing=0 width="95%"><tr><td class=quote><!--/QUOTE--><!--STARTQUOTE--><i>Original post by menyo</i><br>...I'm undertaking a huge project with little knowledge about programming...<br>i tend to make it happen, it might take 20 years but i don't care...<br><br>...I knew i would get replies like this...i'm sorry if this is standard policy for programming forums...<!--QUOTE--></td></tr></table></BLOCKQUOTE><!--/QUOTE--><!--ENDQUOTE--><br>Sorry if i sounded rude.<br>But to my excuse, your opening sentences equaled sentences from other topic starters (in nearly every programming forum) who wanted to create the "next gen mmorpg", which led me to that reaction. ;-)<br><br><!--EDIT--><span class=editedby><!--/EDIT-->[Edited by - Anntor on May 10, 2010 9:20:23 AM]<!--EDIT--></span><!--/EDIT-->   ;  thanks,The last part of your post looked like your sig :D.So for each time i update my page i should run a &#106avascript that actualy refreshes the page on the client side. But would that run "smooth"? Is it possible to just refresh a section?Anyway, first i need to "finish" and implement the design of the login and registration. Then i'm gonna make a ERD for the little test mmo, make a simple design for it, code it and try to make this visual magic to happen.Quote:Original post by Anntoredit:and one last thingQuote:Original post by menyo...I'm undertaking a huge project with little knowledge about programming...i tend to make it happen, it might take 20 years but i don't care......I knew i would get replies like this...i'm sorry if this is standard policy for programming forums...Sorry if i sounded rude.But to my excuse, your opening sentences equaled sentences from other topic starters (in nearly every programming forum) who wanted to create the "next gen mmorpg", which led me to that reaction. ;-)No offense taken as i expected sceptical response :D. But just to make it clear. My intentions at the moment are not creating the best next gen mmorpg but to learn the complete proces of how this is done. You left out "as long as i learn something" in the quote.I know that making a mmorpg takes years and to balance things another couple of years. I am more of a graphics designer, but to know how this proces works, atleast globaly will help me in the future for many different projects i might work on. And just maybe i can put together a dedicated team in a view years to create something epic.Regards, Menno[Edited by - menyo on May 10, 2010 10:53:53 AM];Quote:Original post by menyo...So for each time i update my page i should run a &#106avascript that actualy refreshes the page on the client side. But would that run "smooth"? Is it possible to just refresh a section?...Think about websites like this forum. Everytime you as the user klicks on a link, your browser does the refresh for you. And it refreshes because YOU initiates that refresh with your klick. And it refreshes the whole page.Now you have some websites, which needs to be refreshed without the user klicking on a link or doing anything. Then thats the moment where you're in need of a programmable environment at the user's browser, that will initiate that refresh. Therefore you have something like &#106avascript. And it is possible to just refresh a part of the whole page with &#106avascript.   ;  As i don't have many java experience other then some preloading and mouseover scripting (wich i did actually copy/paste). How much &#106avascript would be involved in a project like this? Should i really learn java(script) as well or would just understanding some parts like refreshing be enough.   