Nothadoth Posted August 16, 2006 Share Posted August 16, 2006 I have a question. At the moment I'm using a script to select and show all items from the database WHERE subcategoryname='$catmode'.Now on some of the ones catmode will be something simple like "Hardware". That's easy.However, i've had it so some of them are "All Hardware" (for example).Is there anyway to put before the WHERE query a code that will say for instance something like.if ($_GET['catmode'] contains "All ") {$catmode = $_GET['catmode'] without "All ";} else {$catmode = $_GET['catmode'];}Obviously that wouldn't work. But is there some way I can do something like that? Or not? Quote Link to comment Share on other sites More sharing options...
Prismatic Posted August 16, 2006 Share Posted August 16, 2006 One way,[code]<?phpif(strstr($_GET['catmode'], "All ")){ $catmode = str_replace("All ", "", $_GET['catmode']);}else{ $catmode = $_GET['catmode'];}?>[/code] Quote Link to comment Share on other sites More sharing options...
Nothadoth Posted August 16, 2006 Author Share Posted August 16, 2006 It didn't work.However it seams looking at my site that I don't actually need this code when I thought I did. Thank you none the less :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.