Jump to content

Passing a php form variable to a mysql statment


scman

Recommended Posts

So I have this data base which has the same names in it as form options that I want to match at a users request. I need to pass the variable from php to mysql but I am stuck trying to do it


I tried this

elseif(!$HTTP_GET_VARS['CS'] == "" and !$HTTP_GET_VARS['KS'] == ""){

$result = mysql_db_query("staffdir","SELECT * from Technology WHERE SELECT * FROM technology where keywords like {$HTTP_GET_VARS[$KS]} ORDER BY last_name");


Can some one point me in the right direction
Link to comment
Share on other sites

Don't use $HTTP_GET_VAR, use the superglobal array $_GET. This is assuming that the method in your form is "GET" or not mentioned. If it is "POST", use the array $_POST.

If you are still having problems, please post the source for your form and your script.

Ken
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.