Jump to content

Problem in getting query result


harikr

Recommended Posts

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>

Link to comment
https://forums.phpfreaks.com/topic/126582-problem-in-getting-query-result/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.