Retrieving the passed ID
<p>I wonder if you guys could help me. I have a table called modules and within it it has moduleID, moduleTitle, moduleCode etc.</p>

<p>A checkbox is populated next to each module that is displayed and the value of the checkbox is the moduleID. When a user checks the modules and click submit they get passed onto another page. On this other page I have managed to retrieve the moduleID's which have been checked but I am having trouble in turning these moduleID so that I can display the moduleTitle, moduleCode etc for the ones that have been checked on this new page.</p>

<p>I have used the following code but no luck  :confused:</p>

<pre><code>  &lt;?php

$cats_upload = "";
    foreach($_POST['module'] as $cats) // errors if no modules are selected
    {
      echo '&lt;p&gt;Module data moduleID: '.$cats.'&lt;/p&gt;';

    }
        $sql = mysql_query("SELECT * FROM modules WHERE moduleID ='".$cats."'");


$productCount = mysql_num_rows($sql); //count the output amount

if($productCount &gt; 0){
    while($row = mysql_fetch_array($sql)){  

    $moduleTitle = $row["moduleTitle"];


        $cats_upload .= "&lt;tr&gt;&lt;td&gt;$moduleTitle&lt;/td&gt;&lt;/tr&gt;"; 

    }
} else { 
    $cats_upload = "&lt;tr&gt;&lt;td&gt;No modules have been selected&lt;/td&gt;&lt;/tr&gt;";
}

?&gt;
</code></pre>

<p>If anyone has any suggestions to what it might be, please let me know.
Thanks</p>
