Okay... I was wondering about this... you have an item. The item costs a dollar. you make several hundred things displaying the item all over your site in different fashions. You change the price all over your site by editing the variable $price
you want to add another item, and plan to keep adding items and changing attributes regularly. what would be the easiest way? Arrays and foreach statements littered across the code? some kind of OOP thing (I have not the slightest clue how to use OOP?) This sounds like a gallery system...
... HOW would I use a database? This is like throwing me out in the desert and saying "water is at an oasis". How would I use a database to update 20+ pages with a new block of code that has the information of the block of code?
price: $3.00 USD
and then 20 pages display that (in different fashions...)
but I want to duplicate the same way it was displayed on all those pages, INCLUDING giving it it's own new page if that needs to be done, just by adding
I appreciate the help, but... It is just confusing me more.
I know you're trying to help, but saying "MySQL is the answer" doesn't help me. I was going to get into MySQL when I started to make the member system I wanted to make.
Originally Posted by Village Idiot
A database is your best solution. If you dont want to use a database, arrays are your next best option.
You basically said the same thing over and over after I said it didn't help.
Lets repeat this for the third time if you don't get it:
There is a code that makes a box on a page called "blue". The box has information in it. Hell, the box fetches information from a MySQL table. Now, there are a whole bunch of pages that do something and display the information in the SQL table.
How would I make it so the function does itself again if there are two tables of information?
(I really hope I don't sound like an asshole here, but this is driving me nuts.)
<h2>iPod nano</h2><h3>price: $ 400</h3><p>Some iPod description here</p><h2>MacBook Pro</h2><h3>price: $ 3000</h3><p>MacBook Pro description here</p><h2>Towel</h2><h3>price: $ 15</h3><p>This is a awesome towel! (it has dolphins on it!)</p>
Aaron, I strongly suggest you get a big fat book on PHP and MySQL, AND a slim book on the same topic AND a slim one on database theory and design. Read the thin ones first, from cover to cover. Then start of the thick book (as the thin ones will only give you a few ideas to get started) and read as much of it as possible.
THEN, when you've tried a lot of the examples/exercises in these all books, attempt your project.
I'm not being funny, database theory is a big subject, and it's clear you need a lot more background knowledge to make progress. And that knowledge is locked up in textbooks, not in a few lines of a reply in a forum.
I still need to lounge through PHP and MySQL for dummies third edition. And that is after PHP 5 for dummies. After that what books will you suggest? (I only get the dummies books because they are free.)