How to pass url value to index? How to read the value from URL and compare with index that i have created in MYSQL table. I have a form where provide list of selection using drop down list and i pass the selected value to the next page URL. Now i want to compare this value with my index. how to do this? please help me. i have something like this at the first form.

 &lt;script language="javascript"&gt;
    function showMe(str)
    {
    document.getElementById('myDiv').innerHTML = 'You have selected :'+str;
    }   
    &lt;/script&gt;
    &lt;select id="ccrseid" name="selectvalue" onchange="showMe(this.value);"&gt;
  &lt;option value=""&gt;Select&lt;/option&gt;
  &lt;option value="1"&gt;Computer Science&lt;/option&gt;
  &lt;option value="2"&gt;Engineering&lt;/option&gt;
  &lt;option value="3"&gt;Business&lt;/option&gt;
  &lt;option value="4"&gt;Education and Training&lt;/option&gt;
  &lt;/select&gt;
  &lt;input type="submit" value="Submit"&gt;
&lt;div id="myDiv"&gt;&lt;/div&gt;


then im trying to get the selected value and check with index that i have created in another form

$id=(int)$_GET['selectvalue'];;

$ret1="SELECT * FROM $db_tb_name WHERE MATCH(Id_index=$id) AGAINST('%$str%' IN BOOLEAN MODE)";
$result1 = MySQL_query($ret1);


but when i run i get this error

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '==2) AGAINST('%%' IN BOOLEAN MODE)' at line 1


how to solve this?
I think you need to revise the design of your db tables. The way you have described where using fixed categories as fields of a table is not so wise, what if you needed to add more categories?

So assuming your problem is to search for keywords of those items belonging to a selected category, here is the way to do it.

We can use two tables in the Database.

Table 1. Categories

==============================
|  ID  | Category            |
------------------------------
|  1   | Computer Science    |
|  2   | Engineering         |


Table 2. Items

=============================================
 ID  |  Category_ID  | Keywords             |
=============================================
  1  |      1        | Keyword A            |
---------------------------------------------
  2  |      2        | Keyword B            |
---------------------------------------------
  3  |      1        | Keyword C            |
---------------------------------------------


Now you can do try the following query in the page that gets the selected id as url parameter.

// you can use $id = $_GET['selectvalue'];
// but do remember to escape the parameter value before passing to the query to avoid any security issues
// therefore use the following

$id = mysql_real_escape_string($_GET['selectvalue']);
$query = "SELECT * FROM ITEMS WHERE category_id = $id";

//Do note that use of mysql_query() is discouraged. Instead, the MySQLi or PDO_MySQL extension should be used. 
//However to give you a simple answer

$result_query = mysql_query($query); 
$result_data = mysql_fetch_assoc($result_query);


If this is not what you are trying to do and if you really want to search for a particular field with keyword values, than here is another option

$selectColumn = $_GET['selectvalue'];
$keywords = "2,3,4";

$query = "SELECT * FROM items WHERE $selectColumn IN ($keywords)";
$result_query = mysql_query($query);


UPDATED

If you want to do a fulltext search as what you are trying to do according to the details in your question, I want you to check the following.

Make sure the index of type is FULLTEXT.
Full-text indexes can be used only with MyISAM tables, and can be created only for CHAR, VARCHAR, or TEXT columns.

Inside the MATCH() you need to put the field names comma separated and AGAINST() can only have a string and optional modifier indicating what type of search you want to do. SO in your case, it should be something like this:

SELECT * FROM TableNameHere WHERE MATCH (fieldA, fieldB) AGAINST ('"$str"' IN BOOLEAN MODE)


try doing a test by using a full query with actual values instead of the $variables in the query.

For more information, have a look at these two links

http://dev.mysql.com/doc/refman/5.5/en//fulltext-search.html

http://dev.mysql.com/doc/refman/5.5/en//fulltext-boolean.html