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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:14:11+00:00 2026-06-02T18:14:11+00:00

I get great tips from this site but am really struggling with something now

  • 0

I get great tips from this site but am really struggling with something now and need some expert help, I am learning so please be nice 🙂 anyway, i have a script that dynamically changes 3 drop down menus depending on what a user selects, i have a database with one table that i can query no problem (mysql) so far so good, the problem is that i cant seem to produce results based on what the user selects from the drop down menu, i dont see any records and i am not even sure if i can use the query with my menu items having numbers as opposed to words, i would appreciate even a small help, i just need to get one bit working then i think i can manage = thanks alot to all

<?php
// Make a MySQL Connection
mysql_connect("localhost", "", "") or die(mysql_error());
mysql_select_db("travel") or die(mysql_error());


$valid_class = array('4', '6', '7', '1', '5', '3');
$valid_category = array('4.1.9', '4.1.7', '4.1.8', '4.1.6', '4.1.5', 
'4.1.2', '4.1.1', '4.1.10', '4.1.4'' 4.1.3', );

$where = array();
$where[] = 'menuOne = "' . mysql_real_escape_string($_POST['menuOne']) . '"';
;

if (in_array($_POST['menuOne'], $valid_class))
{
$where[] = 'menuOne = "' . $_POST['menuOne'] . '"';
}

if (in_array($_POST['menuTwo'], $valid_category))
{
$where[] = 'menuTwo = "' . $_POST['menuTwo'] . '"';
}
// Retrieve all the data from the "category" table
$result = 'SELECT * FROM records WHERE ' . implode(' AND ', $where);



      if(!isset($result))
{
mysql_affected_rows($result);

}
echo "\n <table border=1 width=100%>";

       echo "\n<tr>" .
             "\n\t<th>ID</th>" .
             "\n\t<th>Name</th>" .
             "\n\t<th>Address</th>" .
             "\n\t<th>Location</th>" .
             "\n\t<th>Email</th>" .
             "\n\t<th>Telephone</th>" .
             "\n\t<th>Website</th>" .
             "\n\t<th>Open Season</th>" .
             "\n\t<th>Destination</th>" .
             "\n\t<th>Categories</th>" .

             "\n</tr>";

       while($row = @ mysql_fetch_array($result)) {

          echo "\n<tr>" .
                "\n\t<td>{$row["ID"]}</td>" .
                "\n\t<td>{$row["Name"]}</td>" .
                "\n\t<td>{$row["Address"]}</td>" .
                "\n\t<td>{$row["Location"]}</td>" .
                "\n\t<td>{$row["Email"]}</td>" .
                "\n\t<td>{$row["Telephone"]}</td>" .
                "\n\t<td>{$row["Website"]}</td>" .
                "\n\t<td>{$row["Open Season"]}</td>" .
                "\n\t<td>{$row["Destination"]}</td>" .
                "\n\t<td>{$row["Categories"]}</td>";

       }
       echo "\n</table>";





?>
  • 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-02T18:14:14+00:00Added an answer on June 2, 2026 at 6:14 pm

    In order for your mysql query

    $result = 'SELECT * FROM records WHERE ' . implode(' AND ', $where);

    To work you need to actually send it.

    mysql_query($result)

    What you have currently

    while($row = @ mysql_fetch_array($result)) {

    Is designed to be run on the result of a msql_query call. eg

    $query= mysql_query($result);

    then run

    while($row = @ mysql_fetch_array($query)) {

    So thats your only problem as far as i can see, you have just left out the query.

    Hope that helps, feel free to ask for more details.

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

Sidebar

Related Questions

I wanted to get some info/tips on making a Generic (iOS/Android/WebOS/etc...) Mobile Site. Looking
I know this is a pretty specific question but I managed to get some
Maps are great to get things done easily, but they are memory hogs and
Would be great to get some direction re trying to use sqlite for my
This works great to get the header $imageurl = http://p.twimg.com/AW2-vIUCAAE_1FN.png; $ch = curl_init(); curl_setopt
I love using an IDE, because I get some great productivity gains. However, I
Starting to get my head around makefiles for my C programs, but having some
I'm using the DotNetOpenAuth framework which has been great to get up to speed
I'm trying to get my head around AMQP . It looks great for inter-machine
For example, how to get the version of /usr/lib/libz.a? It will be great if

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.