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>";
}
PHP

Avatar of undefined
Last Comment
MPDenver

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Julian Hansen

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Chris Stanyon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER
MPDenver

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

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

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
ASKER
MPDenver

Thanks for everyone's comments
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER
MPDenver

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.