I am trying to display the selected values in columns as table format from the database.
I have columns name listingsdbelements_field_name
and listingsdbelements_field_value
in the database , i am extracting the data like this
$sql1 = "select listingsdb.listingsdb_id, listingsdb.listingsdb_title, listingsdbelements.listingsdbelements_field_name, listingsdbelements. listingsdbelements_field_value from listingsdb,listingsdbelements where listingsdb.listingsdb_id IN (" . implode(',',$name) . ") AND listingsdb.listingsdb_id = listingsdbelements.listingsdb_id ";
$result = mysql_query($sql1) or die (mysql_error());
while ($row = mysql_fetch_assoc($result)) {
echo $row['listingsdbelements_field_value'];
echo $row['listingsdbelements_field_name'];
}
I want to display it as
<tr><td>Field</td><td>Values</td></tr>
Under Filed
i want to display listingsdbelements_field_name
Under Values
i want to display listingsdbelements_field_value
Can somebody suggest me how to achieve this?