Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

How to do MySQL update

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Watch

ridesign1

Established Member
Impact
7
Hi,
I currently have a table products which has product id as primary key,
I have a Product model field which is currently blank, I want to update this to a number so it is unique as well.

I have exported the table and I have got INSERT code for the table how do I change this to be an UPDATE query:

INSERT query:

INSERT INTO `products` VALUES (170,2, '9', 'l/body37063s.jpg', 'l/body37063.jpg', 'l/body37063l.jpg', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,5.99, '2005-08-02 20:49:46', '2006-07-11 19:38:02', NULL,0,1,0,15, 0);

The first 3 field are:
products_id products_quantity products_model
so 170 is the product id, quantity is 2 and model number is 9
the other fields are just what I got when I exported the table in phpmyadmin, which are present in the table.

Do I change the INSERT to just UPDATE?

thanks
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
ridesign1 said:
INSERT query:

INSERT INTO `products` VALUES (170,2, '9', 'l/body37063s.jpg', 'l/body37063.jpg', 'l/body37063l.jpg', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,5.99, '2005-08-02 20:49:46', '2006-07-11 19:38:02', NULL,0,1,0,15, 0);

The first 3 field are:
products_id products_quantity products_model
so 170 is the product id, quantity is 2 and model number is 9
the other fields are just what I got when I exported the table in phpmyadmin, which are present in the table.

The update syntax would be

UPDATE products SET products_quantity = 2, products_model = 9, etc... WHERE products_id = 170

Hope that helps
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back