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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:46:18+00:00 2026-06-14T08:46:18+00:00

I have the following drop down list <select name=SelP> <option value=0>Please Select…</option> <option value=35>LS1</option>

  • 0

I have the following drop down list

<select name="SelP">
    <option value="0">Please Select...</option>
    <option value="35">LS1</option>
    <option value="35">LS2</option>
    <option value="35">LS3</option>
    <option value="35">LS4</option>
    <option value="35">Postcode not Listed</option>
</select>

and I have written the PHP to work like so

<?php
//Sample Database Connection Syntax for PHP and MySQL.
//Connect To Database
$hostname="localhost";
$username="alloytes_achenry";
$password="**PASSWORD HERE**";
$dbname="alloytes_acquote";
$usertable="LocationTable";
$postcode="postcode";
mysql_connect($hostname,$username, $password) or die ("    <html>%MINIFYHTML4333ddb1f6ba50276851b9f9854a5c817%</html>");
mysql_select_db($dbname);
# Check If Record Exists
$query = "SELECT * FROM $usertable WHERE minimumprice = 35";
$result = mysql_query($query);
if($result)
{
while($row = mysql_fetch_array($result))
{
$postcode = $row["$postcode"];
echo "$postcode";
}
}
?>

This works well and returns the postcode value. I now need to edit the PHP to return both $postcode and $minimumprice , and then to populate the table with the postcode going as the text and the $minimumprice as the value (value=”$minimumprice”).

Any advice where to start would be greatly appreciated

Thanks

Henry

TEST CODE 1

<?php
//Sample Database Connection Syntax for PHP and MySQL.
//Connect To Database
$hostname="localhost";
$username="alloytes_achenry";
$password="f(6@g0^O#2kT";
$dbname="alloytes_acquote";
$usertable="LocationTable";
$postcode="postcode";
$minimumprice="minimumprice";
mysql_connect($hostname,$username, $password) or die (" <html>%MINIFYHTML4333ddb1f6ba50276851b9f9854a5c817%</html>");
mysql_select_db($dbname);
# Check If Record Exists
$query = "SELECT * FROM $usertable";
$result = mysql_query($query);
if($result)
{
while ($row = mysql_fetch_assoc($result)) {
$postcode = $row['postcode'];
$minimumprice = $row['minimumprice'];
echo <<<EOL
<option value="$minimumprice">$postcode</option>

EOL;
}
}
?>
</form>

Returns Just the postcode, any thoughts?

Thanks

  • 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-14T08:46:19+00:00Added an answer on June 14, 2026 at 8:46 am

    Something like this?

    while ($row = mysql_fetch_assoc($result)) {
       $postcode = $row['postcode'];
       $minimumprice = $row['minimumprice'];
       echo <<<EOL
    <option value="$minimumprice">$postcode</option>
    
    EOL;
    }
    

    note the use of a heredoc

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

Sidebar

Related Questions

I have the following drop down list: <select name=selSS1 id=select_value> <option value=val0>sea zero</option> <option
I have the following drop down list and selects the option based on the
I have a drop down list box like following. Under some condition, in the
I have a drop-down list which is generated based on the following sql query:
I have a drop down list displaying values in a select tag that I
I have a drop down list like so: <%= Html.DropDownList(SoldTo, Model.SellDealerList, Select a Dealer)%>
I have a drop down in a jsp page having the following code <s:select
I have the follwing code, I m able to create a drop down list
I have the following drop down menu and the background looks black in Chrome
I have the following code that when i change the drop down it doesnt

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.