html php not properly aligning for each column -


I'm trying to run two loops, the first query in getting the column. The second query takes the primary ID of the primary table and the query executes the end result should be as given in the image

I am not able to correct alignment

code below

  & lt; Table width = "100%" range = "1" cell section = "1" cellpadding = "1" & gt; & Lt; TR & gt; & Lt; TD & gt; Col1 & lt; / TD & gt; & Lt; TD & gt; Col2 & lt; / TD & gt; & Lt; TD & gt; Col3 & lt; / TD & gt; & Lt; TD & gt; Col4 / td & gt; & Lt; / TR & gt; & Lt ;? Php $ mast = mysql_query ("Select from Table 1 * where av_master_id = '". $ _ Request [' id ']. "'"); While ($ res_mas = mysql_fetch_assoc ($ mast)) {? & Gt; & Lt; TR & gt; & Lt; Td> & Lt ;? Php echo $ res_mas ['col1'] ;? & Gt; & Lt; / Td> & Lt ;? Php $ room = mysql_query ("Select * FROM from 'Table 2' where aviory_id = '". $ Res_mas [' av_room_id ']. "'"); While ($ res_room = mysql_fetch_assoc ($ room)) {? & Gt; & Lt; Td> & Lt ;? Php echo $ res_room ['col2'] ;? & Gt; & Lt; / Td> & Lt; Td> & Lt ;? Php echo $ res_room ['col3'] ;? & Gt; & Lt; / Td> & Lt; Td> & Lt ;? Php echo $ res_room ['col4'] ;? & Gt; & Lt; / Td> & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt ;? Php}? & Gt; & Lt; / TR & gt; & Lt ;? Php}? & Gt; & Lt; / Table & gt;  

should do this:

  & lt ; Width of table = "100%" range = "1" cells = "1" cellpadding = "1" & gt; & Lt; TR & gt; & Lt; TD & gt; Col1 & lt; / TD & gt; & Lt; TD & gt; Col2 & lt; / TD & gt; & Lt; TD & gt; Col3 & lt; / TD & gt; & Lt; TD & gt; Col4 / td & gt; & Lt; / TR & gt; & Lt ;? Php $ mast = mysql_query ("Select from Table 1 * where av_master_id = '". $ _ Request [' id ']. "'"); While ($ res_mas = mysql_fetch_assoc ($ mst)) {$ room = mysql_query ("Select * FROM to 'Table 2' where aviroom_id = '". $ Res_mas [' av_room_id ']. "'"); $ Count = 0; While ($ res_room = mysql_fetch_assoc ($ room)) {$ count + = 1; ? & Gt; & Lt; TR & gt; & Lt; Td> & Lt ;? Php echo $ count === 1? $ Res_mas ['col1']: "";? & Gt; & Lt; / Td> & Lt; Td> & Lt ;? Php echo $ res_room ['col2'] ;? & Gt; & Lt; / Td> & Lt; Td> & Lt ;? Php echo $ res_room ['col3'] ;? & Gt; & Lt; / Td> & Lt; Td> & Lt ;? Php echo $ res_room ['col4'] ;? & Gt; & Lt; / Td> & Lt; / TR & gt; & Lt ;? Php}}? & Gt; & Lt; / Table & gt;  

(untested)


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -