PHP Code:
<?php require_once('Connections/db2.php'); ?>
<?php
mysql_select_db($database_DB2, DB2);
$query_Recordset1 = "SELECT * FROM test";
$Recordset1 = mysql_query($query_Recordset1, $DB2) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
while($row_Recordset1 = mysql_fetch_array($query_Recordset1)) {
?>
<p><?php echo $row_Recordset1['name']; ?></p>
<?php
}
?>
Above is where you should place the code. Twey said it would be better to use a table because that's what you are creating, his is a short example which uses the <p> tag.
Below is an example of how you can do this in a table:
PHP Code:
<table>
<tr><td>Name</td><td>Age</td><td>Phone</td></tr>
<?php require_once('Connections/db2.php'); ?>
<?php
mysql_select_db($database_DB2, DB2);
$query_Recordset1 = "SELECT * FROM test";
$Recordset1 = mysql_query($query_Recordset1, $DB2) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
while($row_Recordset1 = mysql_fetch_array($query_Recordset1)) {
?>
<tr>
<td><?php echo $row_Recordset1['name']; ?></td>
<td><?php echo $row_Recordset1['age']; ?></td>
<td><?php echo $row_Recordset1['phone']; ?></td>
</tr>
<?php
}
?>
</table>
Bookmarks