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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:25:38+00:00 2026-05-27T12:25:38+00:00

I have 2-3 questions regarding my sql INSERT and how to go about combining

  • 0

I have 2-3 questions regarding my sql INSERT and how to go about combining multiple $_POST into one field.

  1. i’m having problems with my INSERT statement everything was working till I added m_id=".intval($id)."
  2. for field m_age I need to combine/insert the following three $_POST['month'] $_POST['day'] $_POST['year'] into it. Should I create a var $age = $_POST['month'] + ...; then insert $age into m_age separately?
  3. same as 2. I want combine $_POST['feet'] and $_POST['inches'] into m_height

code:

$fields = explode(" ", "m_id m_pos m_name m_age m_btype m_height");
$query = "INSERT INTO meminfo SET m_id=".intval($id).", ".dbSet($fields, "m_" + $_POST['add']);
  • 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-27T12:25:39+00:00Added an answer on May 27, 2026 at 12:25 pm

    everything was working till I added m_id=”.intval($id).”

    this is not true.

    While m_id=".intval($id)." being correct statement,
    a dbSet($fields, "m_" + $_POST['add']); one makes absolutely no sense.

    but you are right, the dbSet() function is intended to be used like that

    $_POST['m_id'] = $id;
    

    and ‘m_id’ will be added to the set automatically. Same for the other artificial fields

    However, adding an id (assuming autoincrement field) into insert query makes no sense.

    Anyway, seeing your struggle with basic PHP syntax I am going to withdraw my proposal for using dbSet() function.
    You have to write your inserts by hand, until you get familiar with them.
    Otherwise no function will do no good for you.

    The particular problem obviously coming from the m_ prefix you are using for all your fields. A strange whim making things unnecessary complicated. You’d better get rid of it.

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

Sidebar

Related Questions

I have 2 questions regarding performance of PL/SQL script when executing DML. Ofcourse the
I have a few questions regarding Compact SQL. I am using VS C# 2008
I have a few questions regarding sql server in android. Essentially, I am tring
I have couple questions regarding some C++ rules. Why am I able to call
I have several questions regarding filenames and the iPod Library. I understand I can
I actually have two questions regarding the same problem but I think it is
I actually have two questions regarding exception/error handling in the iPhone app that I
I have seen different questions regarding this, but I still find this topic to
I'm very new to TDD world. I have a few questions regarding TDD. Do
I have a couple of questions regarding VBScript and ASP Classic: What is the

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.