Total Inventory in database

This is a discussion on Total Inventory in database within the MySQL Database forums, part of the Database Forums category; Hello everyone and let me say thank you for the help. I'm developing an inventory program using PHP and ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-14-2008
Brian Spotts
 
Posts: n/a
Default Total Inventory in database

Hello everyone and let me say thank you for the help. I'm developing
an inventory program using PHP and MySQL. So far I have the php
developed where you can enter a bar code, and type a quantity, and it
will log the serial and the quantity of that serial in the DB. What I
really want it to do is look to see if the bar code is already in the
database, and if so, then it simply adds the quantity that is being
input to the quantity value already in the DB. Presumably I also need
to subtract from the DB in a similar manner. Any ideas?
Thanks so much,
Brian
Reply With Quote
  #2 (permalink)  
Old 04-14-2008
Captain Paralytic
 
Posts: n/a
Default Re: Total Inventory in database

On 14 Apr, 14:34, Brian Spotts <neoca...@gmail.com> wrote:
> Hello everyone and let me say thank you for the help. I'm developing
> an inventory program using PHP and MySQL. So far I have the php
> developed where you can enter a bar code, and type a quantity, and it
> will log the serial and the quantity of that serial in the DB. What I
> really want it to do is look to see if the bar code is already in the
> database, and if so, then it simply adds the quantity that is being
> input to the quantity value already in the DB. Presumably I also need
> to subtract from the DB in a similar manner. Any ideas?
> Thanks so much,
> Brian


INSERT INTO ... SET..... ON DUPLICATE KEY UPDATE ....
Reply With Quote
  #3 (permalink)  
Old 04-14-2008
Brian Spotts
 
Posts: n/a
Default Re: Total Inventory in database

excellent! Thanks for the quick response, but I'm relatively new to
mysql and php so is there any way you could elaborate on how to use
the command? I'm assuming its something like...
INSERT INTO ~tablename~ SET ~i'm not sure~ ON DUPLICATE KEY UPDATE
~quantity + "quant"~

I know that's not right, sorry I need more help but I'm happy to
realize that it seems to be an easy thing to do for people with more
experience. thanks so much.
-Brian
Reply With Quote
  #4 (permalink)  
Old 04-14-2008
Captain Paralytic
 
Posts: n/a
Default Re: Total Inventory in database

On 14 Apr, 15:25, Brian Spotts <neoca...@gmail.com> wrote:
> excellent! Thanks for the quick response, but I'm relatively new to
> mysql and php so is there any way you could elaborate on how to use
> the command? I'm assuming its something like...
> INSERT INTO ~tablename~ SET ~i'm not sure~ ON DUPLICATE KEY UPDATE
> ~quantity + "quant"~
>
> I know that's not right, sorry I need more help but I'm happy to
> realize that it seems to be an easy thing to do for people with more
> experience. thanks so much.
> -Brian


There's a phrase that goes with this. Its initials are RTFM

Even us "people with more experience" do this. Indeed, it is where we
manage to get our experience. It is said that "the Lord helps those
who help themselves". A similar thing applies here.

http://dev.mysql.com/doc/refman/5.0/en/insert.html
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:07 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0