Monday 15 April 2013

mysql - Update SQL statement with multiple fields within ONE table -


I am trying to write an updated SQL statement for multiple columns within a column. For example, in the product table product table, there are several columns such as name, description, price, quantity, image, category, position.

So I came with this SQL statement:

  string sql = "update smproduct set product description = '+ + + +' ', productp =' + + + + ', Product Quantity =' + Quantity + ', Product Image =' '+ + + +' ', Product Category =' "+ Category + '" WHERE productName =' "+ name +" ';; < / Code>  

However, the compiler told me that there is no alphabet and there is no statement. I am surprised that this statement of SQL statement It should be corrected because I only have a table to update. But within that table, there are several areas

Thank you in advance.

It looks like there are problems with your quote: try

  string sql = "UPDATE sm_product SET productDescription = '" Product Name = '' + Image + "', Product Category ='" + Category + "'WHERE productName ='" + name "+ product name =" + ", productprice =" + value + ", productcontent =" + volume + ", product image = + "'';   

Believes it Price and volume are digital and the remaining strings.

No comments:

Post a Comment