html - How do I return the result of a database query through a php variable to another page using the include function -
i trying occupy html div of page results of database query page via php echo command. here sample code: page performing query $content = '<h3>member login</h3> <?php //step 3: perform db query $member_info = mysql_query("select * members", $db_connect); ?> <?php // step 4: use returned data while($row = mysql_fetch_array($member_info)){ echo "first name: ".$row[1]; echo "last name: ".$row[2]."<br>"; echo "user name: ".$row[3]."<br>"; echo "password : ".$row[4]."<br>"; echo <hr>; } ?> '; include 'foundation.php'; this page issuing echo command(foundation.php): <div id="content"> <?php echo $content; ?> </div><!--end content div--> the database connection established on page know not issue. believe problem syntax because...