Try changing just the SQL to something like this:
// if the id dropdown value DOES NOT equal all use this SQL
if ($_POST['id'] != 'all'){
$query_rs = sprintf("SELECT j* FROM X WHERE id = %s",
GetSQLValueString($colname_rs, "int"));
}
// if the id dropdown value DOES equal all use this SQL
else {
$query_rsActor = "SELECT j* FROM X";
}
--
Ken Ford
Adobe Community Expert - Dreamweaver
Fordwebs, LLC
http://www.fordwebs.com
"jsteinmann" <webforumsuser@macromedia.com> wrote in
message
news:frqhsj$ol4$1@forums.macromedia.com...
> PHP/MySQL
> Form Post
> Drop Down
>
> I want to retrieve all results when users choose the
defaulted drop down
> option of 'select all'.
>
> How to I create the database query on the results page?
>
> I attempted an if else statement, but this leaves the
page blank. Would
> if
> else be the correct approach?... and if so, where is my
syntax error?
>
> if (isset($_POST['securityclearance']) == '' {
> $colname_rs == "#";
> }
> else {
> $colname_rs = "-1";
> if (isset($_POST['id'])) {
> $colname_rs = $_POST['id'];
> }
> mysql_select_db($database_connDB2, $connDB2);
> $query_rs = sprintf("SELECT j* FROM X
> WHERE id = %s", GetSQLValueString($colname_rs, "int"));
> $rs = mysql_query($query_rs, $connDB2) or
die(mysql_error());
> $row_rs = mysql_fetch_assoc($rs);
> $totalRows_rs = mysql_num_rows($rs);
>
>