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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:42:07+00:00 2026-06-11T11:42:07+00:00

I am newbie to php.I have coded auto-complete text box using php,and i have

  • 0

I am newbie to php.I have coded auto-complete text box using php,and i have a submit button.i have not given form action.

This is the HTML form code that i used for autocomplete textbox.this autocomplete textbox selects the value

<form  method="post" autocomplete="off">
    <p>
        <b>Theater Name</b> <label>:</label>
        <input type="text" name="theater" id="theater" />
    </p>
    <input type="submit" value="Submit" />
</form>

I have another php function that retrieves the values based on where clause.in the where statement i want to use selected value from form.

for ex: select address from theaters where theater_name =”form value”

How to use the form value in php function?can any one help me?

 <?php
$con = mysql_connect("localhost","root");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("theaterdb", $con);

$result = mysql_query("SELECT * FROM theter
WHERE theater_name="<!-- This could be value that we get after clicking submit button-->);

while($row = mysql_fetch_array($result))
  {
  echo $row['thearer_name'];
  echo "<br />";
  }
?> 

Thanks in advance……

  • 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-11T11:42:08+00:00Added an answer on June 11, 2026 at 11:42 am

    You could get the value from $_POST by $_POST['theater'].

    And note, you should not use this value directly in the sql, you need to escape it to prevent sql injection.

    $theater = mysql_escape_string($_POST['theater']);
    $result = mysql_query("SELECT * FROM theter WHERE theater_name='$theater'";
    

    Last, you could take a look at PDO, which is suggested over the old mysql_* functions.

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

Sidebar

Related Questions

I am a newbie in MySQL and PHP. I have a HTML form where
I am a newbie in php. I have a form with multiple checkbox values.
I'm a newbie in PHP declaration and i don't understand how to have an
I'm newbie to PHP and I dont know much about database. I have one
Im sure this is simple but newbie here. I have 5 URLS cards.php&type=one cards.php&type=two
Hi I have a web form that sends a string to one php file
Hi i am a newbie to php and am following this tutorial http://tutorialpot.com/2011/06/fancy-contact-form-with-inline-validation/#comment-1771 i
I have to say that I'm a newbie when it comes to php ,
I'm completely newbie in PHP. I have tried example code from this site .
I'm newbie in PHP. I wrote the below-given code to create the array data.

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.