In php working with mysql, how can I output two columns values only once, and then loop thru the others.
Here:
$exe_fetch_data = mysql_query("select category, subcategory, title, body, views from table");
while($row = mysql_fetch_array($exe_fetch_data))
echo $row['category']; //Only once
echo $row['subcategory']; //Only once
{
echo $row['title'];
echo $row['body'];
echo $row['views'];
}
Desired output:
Category->SubCategory //Outputted only once
Title, //Title Body and Views depend on whatever's there in the db. Could be 10 or more
Body,
Views
Title,
Body,
Views
Title,
Body,
Views