After select and group, how to display PHPcode $ result = mysql_query (& quot; SELECT * FROMProductgroupbyp_classlimit40 & quot;); while ($ row = mysq select and group)
PHP code
$result = mysql_query("SELECT * FROM Product group by p_class limit 40");while($row = mysql_fetch_array($result)){ echo nl2br($row['p_class']); }
The result is to display p_class directly one by one to all rows.
My goal is that each different p_class should have its own column.
Remember to use loops in ASP:
[Code = ASP] <%
Dim iiii
Iiii = 1
Do while not rs2.eof
%>
<% = Iiii %>
<% = Rs2 ("AB _jkdw") %>
<%
Rs2.movenext
Iiii = iiii + 1
Loop
%>
<%
Call rs2close ()
Call connclose ()
%> [/Code]
I still don't know how to write in PHP. please recommend it. thank you!
------ Solution --------------------
What does this mean?
PHP code
Echo'
'; Echo'
'; While ($ row = mysql_fetch_array ($ result) {echo"
| $ Row ['p _ class'] | ";} Echo'
'; Echo'
';
------ Solution --------------------
Discussion
Is there a pointer like this in php? after checking the loop writing method, it seems that there is still a lack of pointer cooperation
------ Solution --------------------
Echo"". Nl2br ($ row ['p _ class'])."";
------ Solution --------------------
Syntax error
Because you have other functions in it, you have to change it like this.
Echo"". Nl2br ($ row ['p _ class'])."";
The above syntax error is because $ row ['p _ class'] is written as {$ row ['p _ class']}