![]() |
Millions of actions from one variable?
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... |
You should dive into MySQL(i).. PHP: MySQL - Manual or PHP: mysqli - Manual and maybe some tutorials Google
|
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.
|
A database is your best solution. If you dont want to use a database, arrays are your next best option.
|
... 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?
like... TACO: price: $3.00 USD size: XL 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 taco 2 price: free size: XXL taste: yummy. I appreciate the help, but... It is just confusing me more. |
There are lots of tutorials on the web, I gave you a google search with loads of tutorials. It would be such a waste of time to write another one when there are loads of excellent ones on the web.
read this... |
All I can say is that that doesn't help me at all. I know what MySQL is. I am asking HOW not WHAT.
Quote:
Quote:
Quote:
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.) |
Ok, I'm sorry but it sounded like you didn't knew what MySQL was...
How do you mean "if there are to tables of information"? Or do you mean rows? |
Well...
Each row stores a value, and each column stores a value for that value, right? so table taco price 2.45 size xl and then table taco 2 price 3.56 sixe xxl Well, there are probably more ways to do that O.o I haven't gotten too far into MySQL. You know what... I'm gonna go get something to eat... |
So you really don't understand the use of MySQL if you don't know how to do that :-P
But here's a basic script that does what I think you want to do.. First there is the database structure: ![]() and the database content: ![]() The script: PHP Code:
HTML Code:
<h2>iPod nano</h2> |
Its like an excel spreadsheet.
|
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.)
|
| All times are GMT. The time now is 06:47 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0