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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:27:32+00:00 2026-05-24T13:27:32+00:00

Hi I have an array of Services ordered by user like below $_POST values

  • 0

Hi I have an array of Services ordered by user like below $_POST values printed

Array
(
[compaignID] => 4
[totalChecked] => 3
[hear_about_us] => Google
[videolink] => 
[LinkedIn] => Array
    (
        [0] => 1
        [1] => 1
        [2] => http://developer.comoj.com
    )

[Facebook] => Array
    (
        [0] => 
        [1] => 
    )

[Twitter] => Array
    (
        [0] => 
        [1] => 
    )

[YouTube] => Array
    (
        [0] => 2
        [1] => 4
        [2] => http://developer.comoj.com
    )

[Coupon_Area] => Array
    (
        [0] => 
        [1] => 
    )

[Website] => Array
    (
        [0] => 
        [1] => 
    )

[Google_Map] => Array
    (
        [0] => 
        [1] => 
    )

[Email] => Array
    (
        [0] => 3
        [1] => 8
        [2] => http://developer.comoj.com
    )

[Share_To_Social_Media] => Array
    (
        [0] => 
        [1] => 
    )

[btnSubmit] => Submit
)

I’m confused how to store these. I made these arrays in php form to make their groups like below

for Orders Input field

<input name="<?php echo $service; ?>[]" type="text" id="order<?php echo $service; ?>" size="4">

for Services Check boxes to check which services to take

<input name="<?php echo $service; ?>[]" type="checkbox" id="show<?php echo $service; ?>" value="<?php echo $serviceID; ?>" onclick="countChecked();">

And for Services WebURL the input field below like

<input name="<?php echo $service; ?>[]" type="text" id="<?php echo $service; ?>" size="40">

I’m confused how to get only arrays which have values and store only these services their order number like for showing ascending or descending and their webrurls against each checked checkbox.

I’m confused how to loop through and store in mysql.

Please help me.

Many Thanks

  • 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-24T13:27:33+00:00Added an answer on May 24, 2026 at 1:27 pm

    You can take help of json_encode() and json_decode() functions of PHP solve these things.

    To store and array into mysql, you should use json_encode($yourArray); and you should store the returned string into mysql.

    Similarly for retrieving, you should use json_decode($yourMySqlStoredString) and this will return the array back to you, which you can use for your further manupulations!

    json_encode php function

    json_decode php function

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

Sidebar

Related Questions

I have an array like this : $services = array( array(id => 1, desc
I have array like this: $path = array ( [0] => site\projects\terrace_and_balcony\mexico.jpg [1] =>
An array is defined of assumed elements like I have array like String[] strArray
Have an array of chars like char members[255]. How can I empty it completely
This is an array i have <?php $page['Home']='index.html'; $page['Service']='services.html'; ?> How do i get
I have noticed that some json queries, particularly in google services, return a peculiar
I have ADAM set-up & I've written web-services to complete admin tasks like adding
I have table structure like below: events (boxing, sparring etc) competitors (users who are
I have a web service that returns the binary array of an object. Is
Pretty simple scenario. I have a web service that receives a byte array that

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.