Welcome to WebmasterWorld Guest from 54.166.222.116

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Notice: Undefined index: name

using OOP

     
1:02 pm on Mar 13, 2014 (gmt 0)



I'm having trouble determining where the probolem is. The fields all exist in the database here's the code:

$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>";

}
}

What am I missing? Help please. Thank you1
1:24 pm on Mar 13, 2014 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



"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"

The only fields available are what you select. So the above would only give you:

echo $row['last'];
echo $row['address'];
echo $row['ip'];
echo $row['date'];
echo $row['city'];
echo $row['browser'];
 

Featured Threads

Hot Threads This Week

Hot Threads This Month