High decomposition difficulty: PHP queries MYSQL data and how the record set is specially displayed! MYSQL has a commodity price Statistical Table. you can use PHP to query a commodity and display it on the webpage. the query result is as follows: the difficulty is how to display the commodity by year and month! It's hard for me to die, so I beg for the statement !, PHPcode ............ $ re high decomposition difficulties: PHP queries MYSQL data, how to display the record set in a special way!
MYSQL has a commodity price statistical table,
Query a product in PHP and display it on the webpage. the query result is as follows:
The difficulty is how to display data by year and month! It's hard for me, so I beg for the statement!
------ Solution --------------------
PHP code
................ $ Result = mysql_query ("select year (addtime) as y, group_concat (jiage) as str from table_name group by year (addtime );"); while ($ row = mysql_fetch_assoc ($ result) {echo ''; echo" $ row [y] "; foreach (explode (',', $ row [str]) as $ v) echo "$ v; echo '';}............
------ Solution --------------------
$ Result = mysql_query ("select year (add_date) as y, group_concat (yc_jiage) as str from jiagedata group by year (add_date);") or die (mysql_error ());
Post a prompt.
------ Solution --------------------
Run the command # What information is prompted after the 12th floor.