Hi guys. I'm trying to write out a script that will show certain information based on the id numbers fed to it using Get. Url looks like this blah.php?id=106,105,255 (or something similar) Here's the basic database structure I'm working with - unfortunately it can't be changed or combined into one table. Table: Project_author projectId authorId Table: Faculty facultyid (which is the same as authorId) fname (first name) lname (last name) Table: Project id (same as projectId) Title (title of project) My query would be simple if all of these tables were in one! What I'm trying to do is list out the projects by certain authors. I've accomplished this with the following code: HOWEVER because I have to get each entry by its ID number from a different table one at a time, I can't alphabetize them using ORDER BY lname. I tried doing various joins but it doesn't work. The id numbers are fed to the query using $_GET. Here's what works to list them out - but I need it to be alphabetized. Help! [code] $id = $pieces = explode(",",$_GET['id']); echo "<div align='center' class='title'><strong>Projects by Author</strong></div>"; foreach($id as $k => $authorId) { #Get Author Heading $name = mssql_query("SELECT fname,lname,facultyid FROM Directory.dbo.Faculty WHERE facultyId=$authorId"); while($result = mssql_fetch_assoc($name)) { echo "<ul class='heading'><li>".$result['fname']." ".$result['lname']."</li>"; #Get projects by this AuthorId echo "<ul class='materia'>"; $projects = mssql_query("SELECT DISTINCT projectId FROM Project_author WHERE authorId = $authorId"); while($these = mssql_fetch_assoc($projects)) { $info = mssql_query("SELECT title,id FROM Project WHERE id =".$these['projectId']."ORDER BY title"); while($display = mssql_fetch_assoc($info)) { echo "<li><a href='display.php?project=".$display['id']."'>".$display['title']."</a></li>"; } } echo "</ul>"; } echo "</ul>"; } [/code]