PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > Total Inventory in database
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Total Inventory in database

Réponse
 
LinkBack Outils de la discussion
Vieux 14/04/2008, 16h34   #1
Brian Spotts
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Total Inventory in database

Hello everyone and let me say thank you for the . 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
  Réponse avec citation
Vieux 14/04/2008, 16h50   #2
Captain Paralytic
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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 . 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 ....
  Réponse avec citation
Vieux 14/04/2008, 17h25   #3
Brian Spotts
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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 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
  Réponse avec citation
Vieux 14/04/2008, 17h39   #4
Captain Paralytic
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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 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 s those
who themselves". A similar thing applies here.

http://dev.mysql.com/doc/refman/5.0/en/insert.html
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h06.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09791 seconds with 12 queries