EasyUI Forum
September 13, 2025, 12:32:22 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How to update/delete a record from a table with multiple keys  (Read 6321 times)
kamaljvg
Newbie
*
Posts: 1


View Profile
« on: December 14, 2014, 12:09:00 PM »

I have a product table with two three keys, productBrand,productCode and ProductSerial. The structure is attached .

I would like to know how can I update and delete the records using the grid.

Table Structure

CREATE TABLE `products` (

`ProductBrand` VARCHAR(20) NOT NULL,

`productcategory` VARCHAR(35) NOT NULL,

`productCode` VARCHAR(15) NOT NULL,

`productSerial` VARCHAR(50) DEFAULT NULL,

`productName` VARCHAR(70) NOT NULL,

`productDescription` TEXT NOT NULL,

`productInstock` SMALLINT NOT NULL,

`productOrder` SMALLINT DEFAULT NULL,

`productTransit` SMALLINT DEFAULT NULL,

`productDispute` SMALLINT DEFAULT NULL,

`productText` VARCHAR(4000) DEFAULT NULL,

`productHtml` TEXT DEFAULT NULL,

`productImage` BLOB DEFAULT NULL,

`productstatus` VARCHAR(1) DEFAULT NULL,

PRIMARY KEY (`productbrand`,`productCode`,`productSerial`),

INDEX (`productName`),

INDEX (`productbrand`),

INDEX (`productcode`),

INDEX (`productserial`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;



Thanks in advance for your help.
Logged
ehussain
Newbie
*
Posts: 16


View Profile Email
« Reply #1 on: January 16, 2015, 12:51:48 PM »

$sql = "update products set productName='$productName'  where ProductBrand = '$ProductBrand' and productCode = '$productCode' and ProductSerial = '$ProductSerial' ";

$result = @mysql_query($sql);
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!