Forum Moderators: coopster
$rs = "SELECT homeowners.last AS last, homeowners.Address AS address, statlog.ip_address AS ip, statlog.date_and_time AS date, \n"
. "statlog.city AS city, statlog.browser\n"
. "FROM homeowners\n"
. "INNER JOIN statlog ON homeowners.ip = statlog.ip_address\n"
. "ORDER BY date DESC , homeowners.last LIMIT 0, 300 ";
$rs=$conn->query($sql);
if($rs === false) {
trigger_error('Wrong SQL: ' . $sql . ' Error: ' . $conn->error, E_USER_ERROR);
} else {
$statlog_rows = $rs->num_rows;
}
// Iterate over recordset
// Using column names - recommended
$rows_returned = $rs->num_rows;
echo "<b>There were $rows_returned Rows Returned</b>";
echo "<table border='1'>";
echo "<tr>";
echo "<th>Last Name</th>";
echo "<th>Address</th>";
echo "<th>IP</th>";
echo "<th>Date</th>";
echo "<th>City</th>";
echo "<th>Browser</th>";
echo "<tr>";
$rs->data_seek(0);
while($row = $rs->fetch_assoc()){
echo "</td><td>";
echo $row['homeowners.last'];
echo "</td><td>";
echo $row['name'];
echo "</td><td>";
echo $row['email'];
echo "</td><td>";
echo $row['contribution'];
echo "</td><td>";
echo $row['method'];
echo "</td><td>";
echo "</td></tr>";
}
} "SELECT homeowners.last AS last, homeowners.Address AS address, statlog.ip_address AS ip, statlog.date_and_time AS date, \n"
. "statlog.city AS city, statlog.browser\n"
. "FROM homeowners\n"
echo $row['last'];
echo $row['address'];
echo $row['ip'];
echo $row['date'];
echo $row['city'];
echo $row['browser'];