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

  • Home
  • SEARCH
  • 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 1082721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:20:23+00:00 2026-05-16T22:20:23+00:00

I am using a simple form and submitting my textbox values to database, <body>

  • 0

I am using a simple form and submitting my textbox values to database,

<body>

<?php 

if(isset($_POST["submit"]))
$des="Insert into enquiry(Companyname,Name,Phno,Email,Address,Comments) values 
  ('".$_POST[txtcompname]."','".$_POST[txtname]."','".$_POST[txtphno]."',
'".$_POST[txtemail]."','".$_POST[txtaddress]."','".$_POST[txtcomments]."')";
$res1=mysql_query($des);

?>

<div align="left">
<form action="" method="post">

But it doesn’t seem to get submitted? Any suggestion

When i use print_r($_POST); i get

Array ( [txtcompname] => xv [txtname] => xcv [txtphno] => xcvx [txtemail] => xcv [txtaddresss] => xcv [txtcomments] => xcvxcv [submit] => submit ) 

and i get this error now,

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 'Address,Comments) 
values ('zdc','sadcv','zdsv', 'sdcv','sdvcsdv','sdcv')' at line 2
  • 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-16T22:20:24+00:00Added an answer on May 16, 2026 at 10:20 pm

    i found a few mistakes in your code just by regarding it… make sure you have all warning on so you could see them

    1) Brackets after the if, or else only the assignation of the $des variable will be executed when the form is submitted

    2) $_POST is an array.. you need the quotes $_POST[‘txtcompname’]

    finally make sure that the submit input has name="submit" ,although i think it’s better to evaluate the submit by using if !empty($_POST)

    good luck

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

Sidebar

Related Questions

I am currently submitting a simple PHP form via JavaScript using document.add_driver.submit(); This method
I'm using a simple web form and some PHP script to send the completed
Here is a simple form I am using to send XML data in admin_xml.php
I could submit a form and validate it using a simple anonymous function in
I am using simple form gem and I am wondering how do you do
I have started using Simple-form and Bootstrap and I have tried to follow this
Im using the Simple form gem to setup a form on my rails app.
I have installed VS2010 and MVC2 and testing a simple form using tinyMCE. When
Im using regular asp.net c# (webforms) i need to build a simple form that
I have a simple html login form, deployed on Xcode using phonegap framework. When

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.