harikr Posted October 1, 2008 Share Posted October 1, 2008 hi, I am sending this string "ratings&reviews-projects" and trying the query for this string.I have encoded this string using encodeURIComponent() in javascript and it is sending the string perfectly to my php script. But i dont know why my query is not displaying anything evnthough the query has results. Here is my code, <?php $prod=$_REQUEST['listPrdMenu']; $result=mysql_query("SELECT name from components WHERE product_id=(SELECT id from products WHERE name='$prod')"); ?> <select name="compDetails[]" id="compDetails" size=7 class="style7" multiple > <option value="">- Select -</option> <?php while ($row = mysql_fetch_row($result)) { echo "<option>{$row[0]}</option>\n"; } ?> </select> Quote Link to comment Share on other sites More sharing options...
getmukesh Posted October 1, 2008 Share Posted October 1, 2008 Let us try this query, i have replaced "in" instead of "=" SELECT name from components WHERE product_id in (SELECT id from products WHERE name='$prod') Try this, i think it will solved the problem. Quote Link to comment Share on other sites More sharing options...
harikr Posted October 1, 2008 Author Share Posted October 1, 2008 Sorry man my problem is it is not producing results for that string alone eventhough there are results. For other strings it is working fine 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.