|
|
|
|
![]() ![]() |
Dec 30 2005, 06:22 AM
Post
#1
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 584 Joined: 9-May 05 From: Oshawa, Ontario, Canada, North America, Planet Earth, Our Sun's Orbit, Milky Way Galaxy, The Universe, Beyond Member No.: 6,839 |
I'm planning on a site redesign, and I'm going to add some very basic php includes in there, because I've managed to figure out how to do them. I wanted to use them to do includes of my navigation, so I'd only have to update in one place when new links are added, as opposed to having to update several pages all at once.
I'm not sure what else php can be used for, and I did a search on it, and it pretty much all said includes and databases. Well, databases, I don't know how to make, and I was wondering if it's really worth my time to figure it out or not. I'm wanting it for my language site, if you want to take a look, there is a link in my signature. It's basically several languages, and each one is split up into subcategories that list a bunch of words or phrases that people have submitted to me in their language. Right now, I'm using a simple form, that sends the data to an email, and from there, I sort it out, and add it into my website. I'm not sure if a database would save time / space / something else, but I'd like to know if it would be of any benefit to me, before I go and spend the extra time on it. Would any of you happen to know? Or have any ideas about the whole php / database idea I'm having. Should I bother? Thanks for any insights you might have. |
|
|
|
Dec 30 2005, 08:48 AM
Post
#2
|
|
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1,161 Joined: 9-May 05 From: Brisbane, QLD Member No.: 6,818 |
It's going to depend on how much content, how many different categories you have, and how complex are their relationships.
You can achieve a similar sort of functionality using includes instead of database entries if the nature of the included stuff isn't too complex. If you find you're having to create numerous arrays to get the different types of content into the page, then you should probably think about using a database instead. Learning how to use databases is a valuable tool but it all depends on what you hope to get out of web design/development. If you're just doing it for a hobby and feel like learning how to use databases will be a chore, then don't do it. But if you hope to make something more out of it (ie a career), then using your personal site is a great way to learn new stuff and test it out. From the look of your site, I would probably use a database to display the info cos you have a bunch of higher level categories that have common subcategories. Rather than having numerous different HTML files, you could have just one page that would display the relevant info based on the querystring. For example, instead of http://www.chromlea.trap17.com/mandarin/random.html, you could have http://www.chromlea.trap17.com/?lang=mandarin&type=random. Your page would then pull in from the database all the info relating to 'mandarin' the language and 'random' the word type. |
|
|
|
Dec 30 2005, 09:04 AM
Post
#3
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 584 Joined: 9-May 05 From: Oshawa, Ontario, Canada, North America, Planet Earth, Our Sun's Orbit, Milky Way Galaxy, The Universe, Beyond Member No.: 6,839 |
Oh, okay... that's making some sense to me. Thanks, Tyssen. I think I'll try messing around with a database, and see if I can't come up with something. Web design is going to be my career - I've chosen that already, and am almost through the schooling for it.
I only wish that I knew how to do more stuff. I took a database class, and can't build a database to save my live if I had to, despite getting high marks in that class. It's pretty much a big joke. This semester coming up we have php, so I'll have to wait and see if that goes any better. I'm more of a designer, than a coder, but I'm not that great at either one unfortunately. I'm still trying to find my strengths in the area. So, for the part where I have one page, and pull in the information from the database - Can that be done from clicking on links? I know that inclass, we wrote some sql statements that would pull everything out of the database right when we opened the page (and we didn't click on anything, everything was just there, on a really long page...), but my instructor never explained anything that we were doing. We were just modifying the files that he gave to us. That was in design class, he thought we all knew php, even though we hadn't learned it yet. And in databases, we never learned how to hook a database up to a website just how to enter the stuff into mysql. Sorry if I sound confusing and frusterated, it's four in the morning.... and not a heck of a lot makes sense to me at this point. You are very right though, I need to learn how to do this database / php stuff if this is going to be my career, so thank you for your opinion. |
|
|
|
Dec 30 2005, 09:12 AM
Post
#4
|
|
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1,161 Joined: 9-May 05 From: Brisbane, QLD Member No.: 6,818 |
I was kinda the same as you when I took a database class a few years ago. I wanted to know how it related to building a website but all we learned were SQL statements. At the time I was glad to know some SQL but still could not see what the real world application would be. It wasn't until some time later that I had to redevelop a database-driven site that I got the chance to work out to how to use queries linked to web pages.
In your case, and using the example I gave above, you'd use the querystring to construct your SQL statement, e.g.: CODE Select * from languages where table = ' & $_GET['lang'] & ' and type = ' & $_GET['type']; (I've probably mixed up ASP & PHP code there cos I haven't actually gotten around to creating any PHP scripts that query a database, whereas I have with ASP.) |
|
|
|
Dec 30 2005, 01:34 PM
Post
#5
|
|
|
Ephesians 6:10-17 ![]() Group: [MODERATOR] Posts: 1,893 Joined: 22-June 05 From: The World of Gentoo Member No.: 8,528 ![]() |
Since web design is what you plan on being your career, I would also suggest studying ASP, after learning databases and whatnot, if you havent done so already. Since you might be seeing it in some/many job requirements. Although, in my opinion, PHP is easier and can do practically anything that ASP can. But, I digress.
Knowing databases, MySQL, or any others, is beneficial. But, one downside of using a database is downtime. When the database is inaccessible, your website wont display anything from the database. |
|
|
|
Dec 30 2005, 04:48 PM
Post
#6
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 584 Joined: 9-May 05 From: Oshawa, Ontario, Canada, North America, Planet Earth, Our Sun's Orbit, Milky Way Galaxy, The Universe, Beyond Member No.: 6,839 |
Is down time a big problem in databases? Does it happen often, and is there a way to redirect people to a page saying something along the lines of 'the database is currenly on the fritz... but be sure to check back in a few hours (or days, I don't know how long they typically go down for)?
I did take asp, and I know some of it, but again, I didn't leave that class feeling nearly as comfortable with the language as I would have hoped. Plus, I've heard other people say that php is more common nowadays, plus easier to learn and more expected to be learned for today's job market. --- And thanks for the code example, Tyssen it looks somewhat familiar to the commands that we had to do in design class, and that was apparently php, so I'm guessing they are similar. I'm going to first try and set up a database, and then keep messing around and see what I can get out of it. I'm pretty sure that I can make a nice back end to it all, that'll let me update the database easily, which is one thing that I'm really looking forward to. I'd also like to add the ability to display the contents alphabetically in either the foreign language, or in English. I think I have my work cut out for me. But at least, like you said, playing around with it all on my personal site will get me much more familiar with the language, so that I can use it more readily in the future. |
|
|
|
Dec 30 2005, 05:30 PM
Post
#7
|
|
|
Member [Level 2] ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 87 Joined: 12-March 05 From: somewhere in the UK...if only I knew Member No.: 4,419 |
i often use php with MySql and downtime is not a problem in my scripts. The only down time you might get is when you mess with the scripts and change conn.php or something. other than that the only problems ive had is with server down time and I mean I have been using them for like a year now, but some people may have had different experiences with php and databases.
Php and MySql is is way more cvommon than php and some other database my guess would be that the trap17 forums uses MySql back end but you never know they may use something else. And also PHP can be a steep learning curve if you are trying to learn how to use it with databases at the same time (so many spelling mistakes and typos and little commands to remember so you dont have tio flick through the book every 5 secs...reminds me of Visual basic)...I got so fustrated so many times when I was learning how to code even the basic forums. The best way I learned php was to break the scripts then try and mend them again...sounds kind of stupid but soon I could patch up scripts and then I learned from websites about php at same time and soon I was able to write my own scripts. Best way of learning a language doesnt always require a lot of reading...it can have practical as well. but thats how I learnt php...others will disagree with me fully... |
|
|
|
Dec 30 2005, 11:51 PM
Post
#8
|
|
|
Moderator ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 2,325 Joined: 8-March 05 From: Mawson, Antarctica Member No.: 4,254 |
If you're going to dive into the world of databases, use this: http://sunsite.mff.cuni.cz/MIRRORS/ftp.mys...0.9.2-win32.zip
It's a control center for mysql that lets you see things in a neat little table. It definitely helped me. I started using mysql about 2 weeks ago (my site is now powered by it), and this tool helps me to make quick and easy changes to my table without using a script. |
|
|
|