Well my idea sorta worked. In my tags field which is the field that has keywords for example it one record has keywords like this.
Aiko 3,Victoria,Victoria 3,Clothing,Textures.
those are the words im searching for based on what values my link passed.
HERE is the code I ended up getting to work.
$sql = mysql_query("SELECT * FROM sub_cat_table WHERE itemType=$req ORDER BY sub_catName ");
if(!$sql){
echo "Error Performing MySQL Query:".mysql_error();
}else{
while($row=mysql_fetch_assoc($sql)){
stripslashes(extract($row));
echo '<div style="display:inline;"><a href="inventory.php?req=display&itemType='.$itemType.'&item='.$_GET['item'].'&cat='.$sub_catName.'">'.$sub_catName.'</a> </div>';
}
}
// Display All Items For Selected Item
$sql = mysql_query("SElECT * FROM poser_items WHERE itemType='$itemType'");
while($row = mysql_fetch_assoc($sql)){
stripslashes(extract($row));
if(eregi("^(".$_GET['item'].").+$",$tags)){
echo "<p>$item_name</p>";
}
}
Now the problem i came across its seems if the value in $_GET['item'] if it has the value of "Victoria" it treats it the same as "Victoria 3" therefor displaying the same data which it shouldnt unless specified in the tags.
So for example in my tags field i have keywords are:
Victoria 3,V3,Clothing,Textures
and the Value of $_GET['item'] is "Victoria" in the code above it shouldnt show the results of the previous tags unless the value was "Victoria 3" or V3.
So now I know my problem is my expression is stoping after the a and not including the 3 therefor it will produce incorrect data. So this goes back to not fully understanding the symbols used in regular expressions yet so what symobl would have it include the white space if one is present and include the next character after that?
The if statement I havent played with in laserlights code, it might work the same for what im doing but im more unless using regular expression to try to learn and get a grasp on using them. Anyways more help is needed please. Thanks
ADDED
I just tried using the if version laserlight gave and it still has the same problem it seems to ignore white spaces causing false results, and easy fix would to change "Victoria 3" to Victoria3 but im trying to find away to not do that. So again a solution to to the if problem would be nice too. Thanks