Reputation: 220
I want to create a table(in HTML) which will display rows and columns where i am calling from my query statement i.e.,
select id,name,city from contacts where enquiry_id=125
which will display 3 to 4 rows of data having enquiry_id=125.
The result will be displayed in HTML format for PHP.(or HTML)..
Upvotes: 1
Views: 340
Reputation: 2817
You can try this and do not forget to connect to the database:
while ($record = mysql_fetch_array($result, MYSQL_ASSOC)) {
?>
<tr>
<td><?=$record['id']; ?></td>
<td><?=$record['name']; ?></td>
<td><?=$record['city']; ?></td>
</tr>
<?
}
mysql_free_result($result);
?>
</table>
Upvotes: 1