I was wondering if there is a way to separate the HTML from the PHP PDO with Mysql, but I REALLY do not have time to use a frame (not my website, just helping a little). So I have this code in one file.
<?php
error_reporting( ~E_NOTICE );
require_once 'DB/dbconfig.php';
if(isset($_GET['edit_id']) && !empty($_GET['edit_id']))
{
$id = $_GET['edit_id'];
$stmt_edit = $DB_con->prepare('SELECT * from person where personId=:uid');
$stmt_edit->execute(array(':uid'=>$id));
$edit_row = $stmt_edit->fetch(PDO::FETCH_ASSOC);
extract($edit_row);
}
and I can access all the data just like:
<?php echo $personName; ?>
The problem is when I try to use this php stmt code in ANOTHER file and call it Person::PersonSelect()
I can not use the database data in my HTML file.
I saw a lots of cases and each one of them use the HTML tag inside the echo just like echo '<td>$personName</td>';
but I do no want to build the html through the php echo. So, any ideas? Thank you