Quote:
Originally Posted by Hell Puppy
Your questions are pretty vague. So my initial suggestion is hit Amazon and find yourself a good PHP and MySQL book that suits your skill level.
I can give you some feedback based on what you say above.
First off, you say you can copy the format of an existing table. No way I can say for sure without knowing EXACTLY what you're doing, but a well designed database is the key to having a maintainable, scalable site that performs well. It starts with your database schema, and thus your table designs.
Before deciding how you want to store data, you must think thru how you want to pull the data back out.
Let's say you're creating a database with recipes in it. Seems simple enough to have a single table in there with all of the fields you might want to capture for each recipe yes? And that indeed would work, but it's gonna be a slug on searchs if the database gets very large, and you may limit your search capabilities or make them require extremely complex sql to extract.
What if I want to search recipes by ingredients? Let's say I want to pull back all recipes that have chicken, tomatoes, and garlic. If I didn't design my schema correctly that's a bitch. If I did, it's easily done and very fast.
Consider another scenario. You store recipes by author. Do I put the author in the recipe table? Or do I cross link to an author table? The correct answer is normally cross link. Why? Many reasons, but what if one of the authors wants to change their "handle" or avatar or email address. If it's all in one table, again, that's one god awful nasty query to write. If it's in a separate table, I update one row and it'll display with the update on every recipe in the database when it's pulled back.
As for taking data from forms and inserting into the database, well, that's a big part of what PHP does and it does it well. It'll collect your form data from the POST or GET, then you can manipulate it as you see fit and use PHP to build SQL statements to pass to MySQL to manipulate the database accordingly.
Again your initial questions are too broad, if you get to a point where they're more narrow such as specific SQL queries you need built, post and I can help.
|
You are right, I was to vague. I have been driving myself nuts trying to get everything back up online the past week, and brain thoughts seem to come out all jumbled at times
I am working with a recipe script, one that I have used for a few years. Everything is functional on it, but I wanted to add a new field. I'm not very familiar with PHP, if this was a cgi script, I'd have it in a heartbeat.
In the current category field, it just has a place to put in the category name. I want to add a a field for a decrtiption, or little intro of that category.
Here is one of the recipe sites I'm talking about,
http://www.bbq-grilling-recipes.com and yes, it's still quite empty, but I'm working as fast as I can to get it filled back up again.
I'm probably wanting to do something with it, that isn't going to be able to happen...but that's just the way my life has been the past few months.