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 8093315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:28:45+00:00 2026-06-05T20:28:45+00:00

I have one array that is filled by mysql_query. Values that are in this

  • 0

I have one array that is filled by mysql_query. Values that are in this array I want to put into one continuous string for example:

$array = array(1, 2, 3, 4, 5);

INSERT INTO 'new_slovmas'.'$tabulka'('$array[0]', '$array[1]', '$array[3]') 
       VALUES ('$r_1', '$r_2', '$r_3')";

Sense in one table is over 50 columns I do not want to fill it manually, but by WHILE or FOR. So I was thinking about putting values into one string like this:

$array = array("'1',", "'2',", "'3',", "'4',", "'5',");

so now I have this:

echo $array[2]; => '3',

By the cycle I wont to achieve having multiple entries in one variable.

$str = $array[0], $array[1] ... $array[xy];

INSERT INTO 'new_slovmas'.'$tabulka'('$str') 
       VALUES ('$r_1', '$r_2', '$r_3')";
  • 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-05T20:28:46+00:00Added an answer on June 5, 2026 at 8:28 pm

    Use implode()

    $string = implode(',', array(1, 2, 3, 4, 5));  // $string = 1,2,3,4,5
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one array. I want that array to retain its value between function
I have a for loop that loops over one array... for i=1:length(myArray) In this
I have a numpy one dimensional array c that is supposed to be filled
I have one array that is pre-filled with dictionaries with each dictionary consisting of
I want to implement singleten design pattern in iphone code I have one array.
I have one 'main' thread that creates an array of objects of class SlowData
I have an array which is filled with platforms that are supposed to move.
I have a three dimensional array which I want to fill in with values
I have a 2 dimensional 9 x 9 array (twoArray) that is filled with
I have 2 arrays that I would like to render in a template, one

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.