将myPHP db中的所有变量查询到数组中,以便以后在HTML中使用

I have a database which holds 53 tables of information. I'm trying to figure out how exactly to put the information into an array correctly, so I can refer back to specific content within the database later. For example: I want to be able to grab the "var" by referencing the array and the id. I'm not 100% if this is set up correctly so far. I've done a lot of research and can't find anything specific to what I'm trying to do. Also, if you could give me an example of how to reference the variables later on in the html page that would be a big help, Thanks!

<?php
include_once "code.php";
$sql = mysql_query("SELECT * FROM Variables WHERE id='1'");
$new_array[] = $row;
while($row = mysql_fetch_array($sql)){
$new_array[ $row['id']] = $row;
$new_array[ $row['var']] = $row;
$new_array[ $row['totalVotes']] = $row;
$new_array[ $row['totalYes']] = $row;
$new_array[ $row['totalNo']] = $row;
};
?>

Try this out

<?php
include_once "code.php";
$sql = mysql_query("SELECT * FROM Variables WHERE id='1'");
$new_array = array();
while($row = mysql_fetch_array($sql)){
    $new_array[$row['id']] = $row;
};
?>

Then you can refer to a specific var like this:

<?php echo $new_array[1]['var']; ?>

Or use fetch_all instead fetch array and loop throw until a specific id.