i got error in coding. how to display all field from table after thru a 'if select' function.... where $a and $b are variable in table2....$variable is a field in table1.....
eg:
if (isset($_POST['submit']))
{
if($variable == $a)
{
$query = 'select * from table1 AND table2 where $variable = $a, $variable= $b';
$result =mysql_query($query);
}
if($variable == $b)
{
$query = 'select * from table1 AND table2 where $variable = $a, $variable= $b, $variable= $c, $variable= $d, $variable= $e, $variable= $f, $variable= $g';
$result =mysql_query($query);
$result =mysql_query($query1);
$num = mysql_num_rows($result);
mysql_close();
if ($num > 0 )
{
echo "<table border=\"1\" align=\"center\" bgcolor=\"#BA7474\">";
echo "<tr><th>Cmpny Name</th>";
echo "<th>Member No</th>";
echo "<th>Address</th>";
echo "<th>Name</th></tr>";
$i=0;
while ($i < $num)
{
$Name_syrkt=mysql_result($result,$i,"Name_syrkt");
$No_ahli=mysql_result($result,$i,"No_ahli");
$Addrss=mysql_result($result,$i,"Addrss");
$Name=mysql_result($result,$i,"Name");
echo "<tr><td bgcolor=\"#E2E2E2\">";
echo "$Name_syrkt";
echo "</td><td bgcolor=\"#E2E2E2\">";
echo "$No_ahli";
echo "</td><td bgcolor=\"#E2E2E2\">";
echo "$Addrss";
echo "</td><td bgcolor=\"#E2E2E2\">";
echo "$Name";
//echo "</td></tr></span>";
++$i; } } }
else { echo "<center>Error</center>"; }
?>
after select either $a or $b....submit....i got result 'Error'
please help meπππ