0
kansasskydiver

MySQl and PHP help

Recommended Posts

Alright I'm new to it and trying to figure something out here.

I understand the basis of sql and the database as far as keeping the information, creating tables and being able to search. Serves my purpose for what I'm trying to do. I have a server set up with Apache, php and mysql installed.

What I need to know is, is php able to add to the database and most importantly, output a number of how many rows are filled or subtract from a set number and then echo back the number of available spaces?

Basically a basic ordering system (but a bit more complex) Where I have X available, information is imputed to the table but the next page view will view it as one less in the inventory.

Am I going the right direction or not? Please help
<--- See look, pink dolphins DO exist!

Share this post


Link to post
Share on other sites
  Quote

Alright I'm new to it and trying to figure something out here.

I understand the basis of sql and the database as far as keeping the information, creating tables and being able to search. Serves my purpose for what I'm trying to do. I have a server set up with Apache, php and mysql installed.

What I need to know is, is php able to add to the database and most importantly, output a number of how many rows are filled or subtract from a set number and then echo back the number of available spaces?

Basically a basic ordering system (but a bit more complex) Where I have X available, information is imputed to the table but the next page view will view it as one less in the inventory.

Am I going the right direction or not? Please help



I am not sure I understand exactly what you want. You want to put something in the DB and have the next page show one less? I don't get it.

If it can be done in Mysql, you can do it in php. Use http://www.php.net as a MUST HAVE resource. Search the function list for 'mysql' and see all the stuff that comes back.

PHP is what I work in.

In addition, for your purposes, there is no SET number of available rows in a mySQL DB.

Drop me a pm if you like.
Why yes, my license number is a palindrome. Thank you for noticing.

Share this post


Link to post
Share on other sites
I dont really understand what you want to do either, but you might look at the "COUNT" function in MySQL...it can count the number of records that match certain criteria. That would work if you are establishing a record for each individual item in inventory.

If you have a record for every type of item, but not every individual item, you could just establish a field that is the number available in inventory and subtract the number sold every time a sale is completed. That wouldnt be too difficult to program in PHP.

Share this post


Link to post
Share on other sites
  Quote

What I need to know is, is php able to add to the database and most importantly, output a number of how many rows are filled or subtract from a set number and then echo back the number of available spaces?



most anything is possible. you just need to write the correct php code and SQL queries

Where is my fizzy-lifting drink?

Share this post


Link to post
Share on other sites
Guest
LAMP, the alternative to M$FT...B|

mh

.
"The mouse does not know life until it is in the mouth of the cat."

Share this post


Link to post
Share on other sites
Yes, php/apache/mysql can do everything you want.

You'll be reading from the database (the inventory), using php to subtract one from the inventory, then writing the new inventory back to the database.

Other than the upload function (which uses some perl), SkydivingMovies.com works completely through PHP talking to MySQL (and a few cool videos thrown in there too).

Dave

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

0