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

  • SEARCH
  • Home
  • 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 8165313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:30:25+00:00 2026-06-06T19:30:25+00:00

i want to insert the values of two arrays into a table in a

  • 0

i want to insert the values of two arrays into a table in a single query . Is it possible to do something like that.

table format

id | product_id | category_id | blog_id | updated_by | created_date 

category _id

Array
(
    [0] => 4
    [1] => 15
    [2] => 18
)

Product_id

Array
(
    [0] => 2260 
    [1] => 1401 
)

Blog id = mysql_insert_id();

result

id | product_id | category_id | blog_id | updated_by  
 1      2260        4               15      xyz         
 2      1401        15              15      xyz   
 3      null        18              15      xyz

Any suggestions for me also to improve the better insert query for this.

  • 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-06-06T19:30:28+00:00Added an answer on June 6, 2026 at 7:30 pm
    INSERT INTO `Table_Name` (`product_id`, `category_id`, `blog_id`, `updated_by`) VALUES (2260, 4, 15, 'xyz'), (1401, 15, 15, 'xyz'), (, 18, 15, 'xyz');
    

    I assumed that id column is an auto incremented one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to insert alot of rows into a table that generates the keys
i want to insert two values into two tables of a sql database which
I have a table and want to insert the current values of records that
I have the following table: I want to insert values from the MySQL workbench.
Using VB.Net I want to get a all datagrid cell values, then insert into
I execute an INSERT INTO statement cursor.execute(INSERT INTO mytable(height) VALUES(%s),(height)) and I want to
This is what I want: foreach($_POST['something'] as $something){ foreach($_POST['example'] as $example){ $query = mysql_query(INSERT
I have two tables users registered_members I want to confirm values from user table
I have two arrays with anywhere from 1 to 5 set values. I want
what is wrong with this query? INSERT INTO table1 VALUES id, pic0, pic1, pic2,

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.