Using Two ms sql queries to built one dynamic html table PHP

4z0t3

New Member
I need to select only the course names for my table headers and then use another view to display the table data associate for the courses in the header. I have two views that I am using to build a html table. the first view is dependent on the second. I think my queries are perfect but i can seem to output the data in the tables correctly. I m getting the table headers but only row row of data...Please adviseexample of the table structure I wantMathbook info 1book info 2book info 3Englishbook info 1book info 2book info 3etcThe first query\[code\]$url = $_GET['dept']; $ql = "SELECT distinct intId, etc from viewName where strDepts='$url'"; $q1result = sqlsrv_query( $conn, $ql, $params, array("Scrollable" =>"buffered")); while ($rows = sqlsrv_fetch_array($q1result,SQLSRV_FETCH_ASSOC)){ $listIntId[] = $rows["intId"]; echo "<table ><tr>"; echo "<th colspan='10'>"."<b>". $rows["strSubject"] ." -".$rows["strNumber"]." "."</b>". $rows["strTitle"]."<br>"."</th>"; $valuelist = implode(", ", $listIntId); $rsBooks = "Select * from vwName WHERE intCourseId IN ($valuelist) "; \[/code\]Now I need to list the books associated for each course namePlease help
 
Back
Top