Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4230642
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T01:53:12+00:00 2026-05-21T01:53:12+00:00

i have a table in MySql as: CREATE TABLE products ( sub_product_id int(10) NOT

  • 0

i have a table in MySql as:

        CREATE TABLE products (
          sub_product_id int(10) NOT NULL AUTO_INCREMENT,
          sub_product_name varchar(15) NOT NULL,
          price int(10) NOT NULL,
          available_qty int(10) NOT NULL,
          image1_path varchar(50) NOT NULL,
          image2_path varchar(50) NOT NULL DEFAULT '~//uploaded_img//not_uploaded.jpg',
          image3_path varchar(50) NOT NULL DEFAULT '~//uploaded_img//not_uploaded.jpg',
          image4_path varchar(50) NOT NULL DEFAULT '~//uploaded_img//not_uploaded.jpg',
          image5_path varchar(50) NOT NULL DEFAULT '~//uploaded_img//not_uploaded.jpg',
          shipping_details varchar(200) NOT NULL DEFAULT 'shipping details not specified yet',
          price_details varchar(200) NOT NULL DEFAULT 'price details not specified yet',
          products_brand varchar(50) NOT NULL DEFAULT 'product''s brand not specified yet',
          category_name varchar(15) NOT NULL,
          sub_category_name varchar(30) NOT NULL,
          description varchar(500) NOT NULL,
          product_name varchar(50) NOT NULL DEFAULT 'product''s name not specified yet',
          title varchar(100) NOT NULL,
          user_id int(10) NOT NULL,
          date_of_creation date NOT NULL,
          PRIMARY KEY (sub_product_id)
        ) ENGINE=InnoDB  DEFAULT CHARSET=latin1;

my first query is:

    insert into products (sub_product_name,price,available_qty,image1_path,products_brand,category_name,sub_category_name,description,product_name,title,user_id,date_of_creation) values('','14','45','~//uploaded_img//AD_IMG63.jpg','','Electronics','Camera Digicams','Product Description here','','Product Title Here','43','2011/04/03')

this query is executing

the sub_product_id generated on execution of above insert statement is 38

now my application needs to fire this update query after the previous insert query

    update products set image2_path='~//uploaded_img//AD_IMG64.jpg' and image3_path='~//uploaded_img//AD_IMG65.jpg' and image4_path='~//uploaded_img//AD_IMG66.jpg' and image5_path='~//uploaded_img//AD_IMG67.jpg' and shipping_details='Shipping Details here' and price_details='Price Details here' and description='Product Description here' where sub_product_id=38

but the result is unexpected:

all the fields value is not setting accordingly as stated in the above update query

i am getting the result something like this:
the image2_path fields value becomes 0
and all the rest fields value remains the same un-updated

please help me find the mistake

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T01:53:12+00:00Added an answer on May 21, 2026 at 1:53 am

    instead of

    update products set image2_path='..' and image3_path='..'
    

    try

    update products set image2_path='..', image3_path='..'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MySQL table: CREATE TABLE documents ( id INT NOT NULL AUTO_INCREMENT,
I have mysql database structure like below: CREATE TABLE test ( id int(11) NOT
I have a members table in MySQL CREATE TABLE `members` ( `id` int(10) unsigned
I have a MySQL table consisting of: CREATE TABLE `url_list` ( `id` int(10) unsigned
Lets say I have the following MySQL structure: CREATE TABLE `domains` ( `id` INT(10)
I have an ISAm table in mySql that was created similar to this: create
I have to create a script that takes a mySQL table, and exports it
I have this in a MySQL db: table Message sender_id int recipient_id int created
my MySQL Server (version: 5.0.51a-3ubuntu5.8) I have the following InnoDB table: CREATE TABLE `kontostaende`
I have a product order table in mysql. It's like this: create table `order`

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.