2019-12-13, 02:21 PM
I am using the following code in a custom page/template where I want to display two specific fields from the posts table. The result of $peekmessage is NULL. When I reverse the order of variable assignment statements lines 3 and 4, the result of $peeksubject is NULL. Apparently I can only fetch the content of one field. Obviously I'm doing something wrong.
Why do two sequential fetch_fields fail?
Why do two sequential fetch_fields fail?
$peeksubject = ''; $peekmessage = '';
$query = $db->query("SELECT * FROM " . TABLE_PREFIX . "posts WHERE pid = 637219");
$peeksubject = $db->fetch_field($query, "subject");
$peekmessage = $db->fetch_field($query, "message");
echo("<pre>");
var_dump($db);
var_dump($query);
var_dump($peeksubject);
var_dump($peekmessage);
echo("</pre>");