wilson210484 Posted September 23, 2008 Share Posted September 23, 2008 Hi everyone i such a newb!!! What i want to do is in the product_info.php page of my site i want an if statement, if the model number contains '(g)' then say well anything. i have no idea how to do this and i tried looking at how an sql search works but really i have no idea. here is my code <?php if ($the_product_info['products_model'] LIKE CONVERT('%(g)') { echo 'It works!!!'); ?> any help would be great thanks Quote Link to comment Share on other sites More sharing options...
kpasiva Posted September 23, 2008 Share Posted September 23, 2008 Hi, You have to use string handling functions to achieve this, <?php if (strpos($the_product_info['products_model'],'g') !== false) { echo 'It works!!!'; } ?> Quote Link to comment Share on other sites More sharing options...
wilson210484 Posted September 23, 2008 Author Share Posted September 23, 2008 Thanks i would have been stuck on this for weeks :) :) :) Quote Link to comment Share on other sites More sharing options...
kpasiva Posted September 23, 2008 Share Posted September 23, 2008 Welcome Always here to help -Siva 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.