phpTest

[insert_php]

$host_name = “db592663200.db.1and1.com”;
$database = “db592663200”;
$user_name = “dbo592663200”;
$password = “BRwGVTeCyBBVwixJyGDa”;

$Connect = mysqli_connect($host_name, $user_name, $password, $database);

if(mysqli_connect_errno())
{
echo ‘

Connection to MySQL server failed: ‘.mysqli_connect_error().’

‘;
}
else
{
//echo ‘successfully established connection to MySQL server.’;
}

$Total = array(0);
$Query00 = “SELECT * FROM PAHPmVvsposts WHERE post_type = ‘nf_sub'”;
$Result00 = mysqli_query($Connect,$Query00);
while ($Info00 = mysqli_fetch_array($Result00))
{
//echo “Form ID in DB = ” . $Info00[‘ID’] . “
“;
$InfoA = $Info00[‘ID’];
$Query01 = “SELECT meta_value FROM PAHPmVvspostmeta WHERE post_id = $InfoA AND meta_key = ‘_field_15′”;
$Result01 = mysqli_query($Connect,$Query01);
//echo $Total[‘0’];

//echo “
“;
while ($Info01 = mysqli_fetch_array($Result01))
{
//array_push($Total,$Info01[‘0’]);
$Query02 = “SELECT meta_value FROM PAHPmVvspostmeta WHERE post_id = $InfoA AND meta_key = ‘_field_24′”;
$Result02 = mysqli_query($Connect,$Query02);

while ($Info02 = mysqli_fetch_array($Result02))
{
//echo $Info02[‘0’] . “
“;
$Total01 = $Info01[‘0’] * $Info02[‘0’];
//echo “People * Hours = ” . $Total01;
array_push($Total, $Total01);
}
//echo “Hours value from DB = ” . $Info01[‘meta_value’] . “
“;
//echo “Array dump = “;
//print_r ($Total);
//echo “
“;
//echo “Volunteer hours (running) = ” . array_sum($Total) . “
“;
}
}
echo “Volunteer hours worked on the path (so far) = ” . array_sum($Total) . “
“;
//echo array_sum($Total);

[/insert_php]