php - How to echo extra column with number in each row? -
I have created the table using html, mysql and php. I want to generate an extra column and put a number in each row of this new column.
echo "table" = '1' & gt; & Lt; Tr & gt; & Lt; Th & gt; Rank & lt; / Th & gt; & Lt; Th & gt; Owner ID & lt; / Th & gt; & Lt; Th & gt; Total & lt; / Th & gt; & Lt; / Tr & gt; "; While ($ line = mysql_fetch_array ($ result)) {resonant" & lt; Tr & gt; "; echo" & lt; Td> ". '1'" "& lt; / TD & gt; "; echo" & lt; Td> ". $ Line ['owner_id']" & lt; / TD & gt; "; echo" & lt; Td & gt; ". $ Line ['Total']" & lt; / TD & gt; "; echo" & lt; / Tr> ";} resounds" & lt; / Table> "; Now the rank is an extra column that I have created and where it is 1, I can currently see it in all the rows of this new column. How do I obtain rows 2,3,4 ect? I have tried to insert a new row and insert 2 after "1". "But it just loses its structure to the table.
resonance "& lt; table limit = '1' & gt; & lt; tr & Gt; & lt; th & gt; Rank & lt; / th & gt; & lt; th & gt; Owner ID & lt; / th & gt; & lt; th & gt; Total & lt; / th & Gt; & lt; / tr & gt; "; $ I = 0; While ($ line = mysql_fetch_array ($ result)) {$ i ++; Echo "& lt; tr & gt;"; Echo "& lt; td & gt;" . $ I. "& Lt; / td & gt;"; Echo "& lt; td & gt;" . $ Line ['owner_id'] "& lt; / td & gt;"; Echo "& lt; td & gt;" . $ Line ['total'] "& lt; / td & gt;"; Echo "& lt; / tr & gt;"; } Resonates "& lt; / table & gt;";
Comments
Post a Comment