I am trying to extract the $row elemts with:
$sql = "SELECT date, email, journal, section FROM selection_loggedin WHERE email = '$email' and date in (SELECT max(date) FROM (SELECT date, email FROM selection_loggedin WHERE email = '$email') as x)";
$result = $dbc->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$journal = row['journal'];
$section = row['section'];
print_r($row);
//echo "'$journal'"."'$section'";
echo "<br>".row['email']."<br>";
echo row['date']."<br>";
And I get this:
Array (
[date] => 2017-05-07 12:45:45
[email] => benoitkoen@gmail.com
[journal] => Wall Street Journal
[section] => Economy
)
Why doesn't it print the right stuff ('Wall Street Journal' and 'Economy')?