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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:06:48+00:00 2026-06-09T10:06:48+00:00

I am using following insert command to insert value in my db table called

  • 0

I am using following insert command to insert value in my db table called demo_organization

$sql = "INSERT INTO demo_organization (org_name, abn_acn_no, org_url,city,
                    state, country, pin, street, primary_mobile, 
                    secondary_mobile, primary_landline, 
                    secondary_landline, primary_email,  secondary_email)

            VALUES ($org_name, $abn_acn_no, $org_url, $city, $state, $country, 
                    $pin, $street, $primary_mobile, $secondary_mobile, 
                    $primary_landline, $secondary_landline, $primary_email, 
                    $secondary_email)";

$result = mysql_query($sql) or die (mysql_error());

in php
but i am getting error like

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 ‘://loc.com,Melburn,Melburn,Australia,56007,123 park
avenue,+6190567890,+89685552’ at line 2

i am completely new in php mysql please tell me what i am doing wrong

  • 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-09T10:06:49+00:00Added an answer on June 9, 2026 at 10:06 am

    You are missing single quotes around the text values:

    insert into demo (org_name, abn_acn_no) values ('$org_name', abn_acn_no);
    // assumes that abn_acn_no is numeric.
    

    You also cannot pass an empty variable into the query. If you don’t have it, you will need to insert it as , null, rather than as a variable with no value – which would result in , , which SQL won’t accept – even if the column accepts null values.

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

Sidebar

Related Questions

Dynamically create table and insert data into the created table, I'm using following command
I'm using the following to insert company data into a mysql table. Is is
I'm currently using the following snippet to insert data into a table in my
I'm using the following query: INSERT INTO role (name, created) VALUES ('Content Coordinator', GETDATE()),
I'm using the following code: $query = $dbh->prepare(INSERT into crm_order_errors .SET (order_id, number_of_attempts, last_attempt)
I want to insert the following include tag into my webpage using JavaScript. <!--#include
I have the following table. When i try to insert records using LINQ to
I'm using adapter.InsertCommand to insert some data into a table. The only problem is
I am unable to create a table and insert the values into it using
I have created a sequence called as hibernate_sequnce using following command create sequence hibernate_sequence

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.