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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:33:03+00:00 2026-06-01T13:33:03+00:00

Here is my query // Put it all into the database mysql_query(INSERT INTO orders

  • 0

Here is my query

// Put it all into the database
mysql_query("INSERT INTO 
    orders (
        item_id, 
        order_id, 
        contact_first_name, 
        contact_last_name,
        contact_email,
        contact_phone,
        business_name,
        business_type,
        business_website,
        business_address,
        business_city,
        business_state,
        business_zip,
        business_phone,
        promo_code,
        add_details
    ) 
    VALUES(
        ". $post_data['item_id'] .", 
        ". $order_hash .",
        ". $post_data['contact_first_name'] .", 
        ". $post_data['contact_last_name'] .",
        ". $post_data['contact_email'] .",
        ". $post_data['contact_phone'] .",
        ". $post_data['business_name'] .",
        ". $post_data['business_type'] .",
        ". $post_data['business_website'] .",
        ". $post_data['business_address'] .",
        ". $post_data['business_city'] .",
        ". $post_data['business_state'] .",
        ". $post_data['business_zip'] .",
        ". $post_data['business_phone'] .",
        ". $post_data['promo_code'] .",
        ". $post_data['add_details'] ."
    ) 
") or die(mysql_error());

Right now if I fill in all the forms so that there is no empty strings it gives me this error. The hash is $order_hash:

Unknown column ’76a051b750ce9363cec3df9961d2fd6b’ in ‘field list’

If I leave some blank then it gives me:

You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near ‘ 1, , , , AL, , , , )’ at line 27

I have tried multiple variations with double quotes, single quotes, etc and can’t seem to figure it out. This should be a simple insert query that like I have done before but I just have run a muck with this one. Thanks for all of your help 🙂

  • 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-01T13:33:05+00:00Added an answer on June 1, 2026 at 1:33 pm

    You need to write strings inside quote. Otherwise mysql will take them as column. For example:

    ...
    '". $post_data['contact_first_name'] ."', 
    '". $post_data['contact_last_name'] ."',
    ...
    

    OR more simple (when using doublequote for query)

    ...
    '{$post_data['contact_first_name']}', 
    '{$post_data['contact_last_name']}',
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the query which will get me all the contacts have HD quality
Here's some example code: $sql = INSERT INTO Users (Firstname,Surname) VALUES ('$firstname', '$surname'); $stmt
Simple php/mysql INSERT such as mysql_query(INSERT INTO dispatch VALUES('1234','$name','$address')); intermittently fails. I've set it
I am trying to figure out how to put a mysql query result into
I'm stuck with another coordinates related query here. I have a number of CSV
Here's the query: SELECT COUNT(*) AS c, MAX(`followers_count`) AS max_fc, MIN(`followers_count`) AS min_fc, MAX(`following_count`)
Here is my query Select Gender from Table The result pane shows 1 1
Here is the query that I am working on: SELECT `unitid`, `name` FROM apartmentunits
Here's my query: DECLARE @StartRow INT DECLARE @PageSize INT SET @StartRow = 1 SET
Here is my Query : select EmployeeName, EmployeeSalary from Employee2 for xml path('EmployeeDetails') returns

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.