Link to home
Start Free TrialLog in
Avatar of MPDenver
MPDenver

asked on

PHP SQL LOOKUP

Im using the following function to pull records for a dropdown. The dropdown is working however the results are not what I am looking for.

I cant get the NOT IN to work below its just displaying all the records in "$strTableName " and not removing the matching field "onetimeID" in the picksummary table..

Any advice would be greatfull.

Thanks

function OneTimedropdown($intIdField, $strNameField, $strTableName, $strNameOrdinal, $strOrderField, $userID, $strMethod="asc") {
   
   echo "<select name=\"$strNameOrdinal\">\n";
   echo "<option value=\"NULL\">".$strMaskName."</option>\n";
   
   
   $strQuery = "select $intIdField, $strNameField
            from $strTableName
                 WHERE $strNameField NOT IN (select onetimeID FROM nflp_picksummary where userID = '" . $user->userID . "')";
                        
   $rsrcResult = mysql_query($strQuery);

   while($arrayRow = mysql_fetch_assoc($rsrcResult)) {
      $strA = $arrayRow["$intIdField"];
      $strB = $arrayRow["$strNameField"];
      echo "<option value=\"$strA\">$strB</option>\n";
   }

   echo "</select>";
}
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MPDenver
MPDenver

ASKER

I've requested that this question be deleted for the following reason:

I received recommendations and no solutions to my question.
I received recommendations and no solutions to my question.

You have not responded to questions posed by experts regarding this issue. If you want a solution - please respond so that we can find a solution
Thanks for everyone's comments
I was not intending to be rude or unprofessional.  I resolved the issue in an other manner and felt closing the forum was appropriate.  Everyone got their points now so be happy.