I have the following code that i'm trying to use and won't work. What's the syntax when printing out variables within a print EOF? The second $row['title'] won't work and makes the entire page not load.

$db = new mysqli('localhost','root','root','cnubuzz');

if(mysqli_connect_errno())
	echo 'error in new $r';
$query = "SELECT * FROM cnubuzz_events2 WHERE end_date>= now() AND frequency='multi-day' ORDER BY end_date";
$r = $db->query($query);
$num_results = $r->num_rows;

//for($i=0;$i<$num_results;$i++) {
	$row = $r->fetch_assoc();

echo($row['title']);
print <<<EOF

<div class="dhtmlgoodies_question"><h4>dates</h4>$row['title'])</div>
<div class="dhtmlgoodies_answer">
	<div><strong>times</strong><br /><br />description<br /><br />Sponsored by .</div>
</div>

EOF;
//}

    Just like with doubl-quoted strings, if you want to use array elements with quoted indexes, you need to use "complex variable notation" (curly braces):

    print <<<EOF
    
    <div class="dhtmlgoodies_question"><h4>dates</h4>{$row['title']})</div>
    <div class="dhtmlgoodies_answer">
        <div><strong>times</strong><br /><br />description<br /><br />Sponsored by .</div>
    </div>
    
    EOF;
    
      Write a Reply...