cheryl
02-15-2006, 02:13 PM
<style type="text/css">
<!--
.style1 {
color: #FF6600;
font-family: Verdana;
font-weight: bold;
}
.style2 {font-family: Verdana}
-->
</style>
</head>
<body>
<?
include("db.php");
$link = @mysql_connect("localhost", $dbusername, $dbpassword);
if (!$link)
die ("Couldn't connect to MySQL");
mysql_select_db($dbname, $link)
or die ("Couldn't open $db".mysql_error());
$orgSelect = "Select clientName From client Order By clientName ASC";
$orgSelected = mysql_query($orgSelect, $link)
or die ("Couldn't execute orgSelect query");
while ($row = mysql_fetch_array($orgSelected))
{
$orgoption = $row["clientName"];
$clientOp .= "<OPTION value=`".$row[0]."`>".$row[0]."</OPTION>";
}
$tableSelect = "Select member, nonmember, nimember From forzanim_imsdb";
$tableSelected = mysql_query($tableSelect, $link)
or die ("Couldn't execute tableSelect query");
while ($row = mysql_fetch_array($tableSelected))
{
$tableOption = $row[""];
$tableOp .= "<OPTION value=`".$row[0]."`>".$row[0]."</OPTION>";
}
?>
<form method="POST" action="searchresults.php">
<table width="430" border="0"> ">
<tr>
<td width="363"><span class="style1"><u>Search</u></span></td>
</tr>
<tr>
<td><span class="style2">Organisation:</span><span class="style4">
<select name="clist" id="clientlsit">
<?php echo "$clientOp";?>
</select>
</span></td>
</tr>
<tr>
<td class="style2">Member Type:
<select name="typetable" id="mtypetable">
<? echo "$tableOp";?>
</select></td>
</tr>
<tr><td colspan='2' align='center'><input type="SUBMIT" name='submit' value="Search"> <input type="reset" name="Reset" value="Reset"></td>
</tr>
</table>
</form>
</body>
</html>
i can't seem to populate the dropdown list from database.
Wanna retrieve clientName from client table, and the member, nonmember and nimember table from db.
i'm getting "Couldn't execute tableSelect query" error.
someone please help see if anything wrong with the codes.
<!--
.style1 {
color: #FF6600;
font-family: Verdana;
font-weight: bold;
}
.style2 {font-family: Verdana}
-->
</style>
</head>
<body>
<?
include("db.php");
$link = @mysql_connect("localhost", $dbusername, $dbpassword);
if (!$link)
die ("Couldn't connect to MySQL");
mysql_select_db($dbname, $link)
or die ("Couldn't open $db".mysql_error());
$orgSelect = "Select clientName From client Order By clientName ASC";
$orgSelected = mysql_query($orgSelect, $link)
or die ("Couldn't execute orgSelect query");
while ($row = mysql_fetch_array($orgSelected))
{
$orgoption = $row["clientName"];
$clientOp .= "<OPTION value=`".$row[0]."`>".$row[0]."</OPTION>";
}
$tableSelect = "Select member, nonmember, nimember From forzanim_imsdb";
$tableSelected = mysql_query($tableSelect, $link)
or die ("Couldn't execute tableSelect query");
while ($row = mysql_fetch_array($tableSelected))
{
$tableOption = $row[""];
$tableOp .= "<OPTION value=`".$row[0]."`>".$row[0]."</OPTION>";
}
?>
<form method="POST" action="searchresults.php">
<table width="430" border="0"> ">
<tr>
<td width="363"><span class="style1"><u>Search</u></span></td>
</tr>
<tr>
<td><span class="style2">Organisation:</span><span class="style4">
<select name="clist" id="clientlsit">
<?php echo "$clientOp";?>
</select>
</span></td>
</tr>
<tr>
<td class="style2">Member Type:
<select name="typetable" id="mtypetable">
<? echo "$tableOp";?>
</select></td>
</tr>
<tr><td colspan='2' align='center'><input type="SUBMIT" name='submit' value="Search"> <input type="reset" name="Reset" value="Reset"></td>
</tr>
</table>
</form>
</body>
</html>
i can't seem to populate the dropdown list from database.
Wanna retrieve clientName from client table, and the member, nonmember and nimember table from db.
i'm getting "Couldn't execute tableSelect query" error.
someone please help see if anything wrong with the codes.