Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

59 users online



Correct me if I'm wrong (again)

Correct me if I'm wrong (again)

Currently viewing this thread: 1 (0 members and 1 guests)


Page 2 out of 4
victorvp

victorvp

Victor van Poppelen
Status: Offline!

I think it would be a lot easier for you to understand db's if you downloaded MySQL and played around with it yourself. I think the download site is http://dev.mysql.com/downloads/ . Download 4.1 or 4.0 or whatever, than follow the tutorial at www.php-mysql-tutorial.com to configure the two, and then just fiddle around with them. It's not that hard to understand once you actually start working with them

___________________

Say it with me now: SIGNATURE GUIDELINES!

BigToach

BigToach

Neversidian
Status: Offline!

sry i posted right when the server went down so it douple posted for some reason. just look at a phpmyadmin and a forum or something and youll see how stuff works

___________________

Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

Ynhockey

Ynhockey

Neverside Newbie
Status: Offline!

A database stores structured data. For example, if you want to store someone's details (with name, last name, phone, etc.), it is structured data. Therefore it's better to use a database. Basically, you'd store in a database what W3 fanboys (you're one of them from what I understand...) call 'tabular data'. For anything but that, it is not recommended to use a database. Text, such as:

_______________________
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
_______________________

is NOT structured data on its own and should not be stored inside a database. For organizing file paths, depends on what you want. My site (http://www.web-realm.com) uses that partially for the menus, but it's not really necessary especially if you have a mostly fixed (unchanging) menu like so many sites out there.

And yes you need to know SQL to work with databases.

___________________

Learn HTML

Rad

Rad

thinking of something witty to put here
Status: Offline!
Quote:

Originally posted by Ynhockey
Basically, you'd store in a database what W3 fanboys (you're one of them from what I understand...) call 'tabular data'.

I knew what tabular was before knowing what the W3 was and it's a commonly used term, nothing defined by the W3. Stop your stupid stereotypes.

Edit: What do you know, my 4,000th post!

Last edited by Rad, November 14th, 2004 05:21 AM (Edited 1 times)

Ynhockey

Ynhockey

Neverside Newbie
Status: Offline!

Radley, what I meant was that tabular data is actually anything that can be represented in a table, a table being just about anything with a rectangular shape and rows and columns. This is far from just small pieces of text and numbers that W3C supporters (ok, I'll get rid of 'fanboys' Tongue) say should go into a table (while absolutely NOTHING else should). These are 2 different definitions of 'tabular data' and you can't say that one is 100% correct against the other. I was simply making it clear that I meant the 2nd definition.

___________________

Learn HTML

Agatio

Agatio

Neversidian
Status: Offline!

Slow down guys!
So, here's what I'm getting so far...

- I store the raw content from my site all in text files (written in notepad), then put them all into the database, and the database adds the header and foot to all of them turning them into pages?

- A database looks like an excel spreadsheet. How many columns and rows should I make, and what should they be called?

- Is sql a programming lanuage like Javascript, html, css, php c++ etc.? How much of it do I have to learn?

- With many other sites, all the're page locations are "index.php?page=66". Is this because index is the main location, and in index.php, the navigation bar is written in php to link to all the files/pages/data in the database?

- Is a database a way of organising pages in folders, or a should I think of it as a folder of it's own where everything is stored and easily retrieved using php?

- How do I go about putting my pre-existing content into a mysql database?

phew, this is very confusing, but you guys are doing a great job explaining it, thanks heaps!

Ynhockey

Ynhockey

Neverside Newbie
Status: Offline!

1) No. Your header and footer (or template file) should also be in a normal text file (made in notepad or another text editor). This is of course not required, but it's standard practice. When someone said 'use a database to organize your pages', they (most likely) meant that you should put the paths to your pages into the database so that when you have links on your site (like a menu), it can get the items from the database. This can also be used for things like permissions - check against the database to see if the page the user wants is allowed. There are numerous other uses, but it's also not required (and not really important for most) to organize your files using a database.

2) A database actually doesn't look like anything, it's just represented like an excel file (each table beeing like a separate spreadsheet). In any case, you don't make rows initially (rows are called 'records' btw), you only make the columns (called 'fields'). You can make those in PHPMyAdmin without knowing SQL. As for how many and what types, it entirely depends on your script. But if you go over the script and realize you don't need at least 3 fields, it's most likely a better idea to use text files than a database.

3) SQL is not really a programming language. It's a 'query language' - a set of commands and structures to execute queries on a database. It's a very simple langauge which takes no more than a couple hours to learn. www.sqlcourse.com - the best SQL guide online.

4) index.php?page=66 has nothing to do with a database. It has to do with a pre-set array in PHP called get ($_GET) - if you know basic PHP you should know this. Read more at:
http://www.web-realm.com/guide/index.php?page=php_-_phpch4
http://www.web-realm.com/guide/index.php?page=php_-_phpch42
(Read the 1st one first if you will).

5) A database has no real relation to folders, and doesn't work like a file/directory system.

6) If you have pre-existing content in text files, you don't likely need to use a database to store this content. But if you REALLY need to, you can use the INSERT statement in SQL (learn SQL first, then you'll know).

___________________

Learn HTML

Agatio

Agatio

Neversidian
Status: Offline!

Do I store the the template as 2 files, top and bottom, or as 1?

So if I am just using a database to organise pages, I will need 2 columns?

2 hours, well, it's usually double for me Tongue

So I really need to learn PHP? (I will look at those guides).

So a database is a way of organising whats in your folders, not a folder of it's own? And when I "put" something into the database, I'm not putting the file as such, but the foles location?

I will try learning sql now.

Natural_Cause

Natural_Cause

Status: Offline!
Quote:

Originally posted by Ynhockey
3) SQL is not really a programming language. It's a 'query language' - a set of commands and structures to execute queries on a database. It's a very simple langauge which takes no more than a couple hours to learn. www.sqlcourse.com - the best SQL guide online.

i have to disagree with that. the basics of sql are easy to learn. such as selects inserts deletes updates. but theres heaps to learn to in sql. left joins right joins middle joins, user defined functions, procedures, temporty tables, constrants, the deeper you go the bigger the site the more complicated your sql can get

___________________

http://whatpulse.bounceme.net/sig/naturalcause.png

Ynhockey

Ynhockey

Neverside Newbie
Status: Offline!

It's still easy to learn, including joins and predefined functions. Guess there are a lot of things which most don't learn, but that usually means they're not really important. Somewhere I had a bunch of pages which listed and explained everything SQL had to offer... there were about 20, but they weren't really difficult.
Of course, each database system (i.e. MySQL) has its own set of functions, etc. so those could take additional time to learn.

@Agatio:
1) That's up to you. There aren't any significant advantages or disadvantages for either from what I understand.
2) I said in the previous post that if you need 1-2 columns only, you probably won't need to use a database. However, in the case of organizing pages, I'd say you'd need at least 3 - a title/caption (i.e. Main), a URL (i.e. home.php) and an ID field. Depending on what you're using this for, you could have more fields (for example, I'm using it for a menu, so i have a TARGET field).
3) Yes.
4) A database has nothing to do with folders or organizing files. You can use it to organize files if you want, but that's not its main use, or even a common use. Databases are mostly used to store structured data (as I said before), such as a member list for example. If you do want to use it for organizing files, what you put in the database is the path of the file. If you don't know what a path is, try this link: http://www.web-realm.com/guide/index.php?page=html_-_htmlch3 (no offense, but from the anti-table claims you made on the client-side forum, I assumed you already mastered [X]HTML and CSS).

___________________

Learn HTML

Page 2 out of 4
Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0101 seconds.