Not able to store selected fields from drop downlist to variables
<p>Not able to store multiple fields selected from drop down lists in form to variables in php using GET syntax. I am doing a search query list data in field based on the selection. </p>

<p>My Code;</p>

<p>The code is as below;</p>

<p>HTML Form;</p>

<pre><code>&lt;html&gt;
&lt;body&gt;
&lt;form action="search3.php" method="GET"&gt;
&lt;Table&gt;
&lt;tr&gt;
&lt;td&gt;
Transaction:&lt;/td&gt;
&lt;td&gt;
&lt;Select name="Transaction"&gt;
&lt;Option value ="Buy"&gt;Buy&lt;/Option&gt;
&lt;Option value ="Sell"&gt;Sell&lt;/Option&gt;
&lt;Option value ="Rent"&gt;Rent&lt;/Option&gt;
&lt;/select&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
PropertyType:&lt;/td&gt;
&lt;td&gt;
&lt;Select name="PropertyType"&gt;
&lt;Option value ="Land"&gt;Land&lt;/Option&gt;
&lt;Option value ="Apartment"&gt;Apartment&lt;/Option&gt;
&lt;Option value ="Commercial"&gt;Commercial&lt;/Option&gt;
&lt;Option value ="Other"&gt;Other&lt;/Option&gt;
&lt;/select&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
Location: &lt;/td&gt;
&lt;td&gt;
&lt;Select name ="Location"&gt;
&lt;Option value ="Mumbai"&gt;Mumbai&lt;/Option&gt;
&lt;Option value ="Thane"&gt;Thane&lt;/Option&gt;
&lt;Option value ="NaviMumbai"&gt;NaviMumbai&lt;/Option&gt;
&lt;Option value ="Other"&gt;Other&lt;/Option&gt;
&lt;/select&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;input type="submit" value="submit"/&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/Table&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt; 
</code></pre>

<p>PHP Code</p>

<p><pre></p>

<pre><code>&lt;?php
</code></pre>

<p>$Var2 = $_GET['PropertyType'];
$Var3 = $_GET['Location'];
$var1 = $_GET['Transaction'];
echo $var1;
echo $var2;
echo $var3;
$trimmed1 = trim($var1); //trim whitespace from the stored variable;
$trimmed2 = trim($var2); //trim whitespace from the stored variable;
$trimmed3 = trim($var3); //trim whitespace from the stored variable;
$db="landshop_clientdata";
$link = mysql_connect('localhost','root');
if (! $link)
{die("Couldn't connect to MySQL");}
mysql_select_db($db , $link) or die("Couldn't open $db: ".mysql_error());
$result = mysql_query("SELECT Agent_Ind,Title, firstname,lastname,Phone,email,Transaction,propertyType,Location,Area,Units,AdditionalData FROM clientdata where Transaction ='$trimmed1' AND PropertyType = '$trimmed2' AND Location = '$trimmed3' AND '$trimmed2' AND '$trimmed3") or die("SELECT Error: ".mysql_error());
//$describe = mysql_query("SHOW COLUMNS FROM $table")
//$meta = mysql_fetch_field($result);
// $fields_array[]=$meta->name;
$num_rows = mysql_num_rows($result);
print "There are $num_rows records.<P>";
print "These are records for $trimmed1.<p>";
//$row = mysql_fetch_assoc($result);
print "\n";
//while ($get_info = mysql_fetch_row($result))
//print "\n";
//foreach ($get_info as $field)
//print "name : " 
//print "$field";
Print " Agent or Individual ";
Print " Title ";
Print " First Name ";
Print "Last Name";
Print " Phone ";
Print " Email ";
Print "Transaction";
Print " Location ";
Print " Area ";
Print " Units ";
Print " Additional_Data_of_Property ";
while($info = mysql_fetch_array( $result ))
{
print "\n";
Print "log in to see\n";
Print "log in to see\n";
Print "log in to see\n";
Print "log in to see\n"; 
Print "log in to see\n";
Print "log in to see\n";
Print "".$info['Transaction'] . " \n";
Print "".$info['Location'] . "\n";
Print "".$info['Area'] . "\n";
Print "".$info['Units'] . "\n";
Print "".$info['AdditionalData'] . "\n";
print "\n";
}
print "\n";
mysql_close($link);
echo ("Want to view full contact details\n");
print( 'Login or Register' );
echo ("Click to return to landshoppe\n");
print( 'Click Me' );
    ?></p>

<code>......
</code></pre>
