[PHP]index
<?php
include ("conn.php");
require_once("tabs.php");
?>
<html>
<head>
<?php tabs_header(); ?>
</head>
<body>
<div style="width:600px;">
<?php tabs_start(); ?>
<?php tab( "Junior Colleges" ); ?>
<form id="form1" name="form1" method="post" action="dd2.php">
<?PHP
$query = 'SELECT DISTINCT schName FROM schools';
//$query2='SELECT DISTINCT schLocation FROM schools';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
echo "<select name=select value='' ><option>Please select</option>";
while($nt=mysql_fetch_array($result)){//Array or records stored in $nt
echo "<option value=$nt[schName]>$nt[schName]</option>";
/* Option values are added by looping through the array */
}
echo "</select>";// Closing of list box
echo '<input type="submit" value="Yes" />';
?></form>
<?php tab( "PolyTechnic" ); ?>
This is the second tab.
<?php tabs_end(); ?>
</div>
</body>
</html>
[/PHP]
[PHP]Display result
<?PHP
include ("conn.php");
?>
<?PHP
$schName=$_Get['select'];
$query = "SELECT schName FROM schools where schName='$schName'";
$numresults = mysql_query($query) or die ("<center>Couldn't execute query</center>");
$row= mysql_fetch_array($numresults);
echo $numresults;
echo $row;
print $schName;
echo '<br>';
echo "<center><h1>Search results for: " . $schName ." </h1></center>";
?>
[/PHP]
Error Message when supposed to display result:
Couldn't execute query
"); $row= mysql_fetch_array($numresults); echo $numresults; echo $row; print $schName; echo '
'; echo "
Search results for: " . $schName ."
"; ?>
Any1 knows what is wrong with my statement??