php not working

Status
Not open for further replies.

1Tsme1941

Member
Hi again, I'm totally perplexed. I have been using xampp, mysql and php for years without
problems but now when I try to execute any php file the result is php code. I don't want to
mislead but this started when I began converting php code from mysql to mysqli.

All the while I was changing from windows 7 home premium 32 bit to windows 7 professional
64 bit. I have confirmed my databases, get no errors and don't know how to proceed. I
load this PHP file(certlog.php) with an HTML file(<a href="certlog.php" target="Main">
certlog</a><br>
I'm sending an example.
-----------------------------------------------------------------------------------------
here is code:

<html><body>
<hr>
<center><b><font size=+2> 515 Certification Expiration Report</font><br>06/22/2020 - 06/22/2021<p>

<hr>
<?php

// Report all PHP errors
error_reporting(E_ALL);

// Include config file
require_once "getprerentdb.php";

$apt = $_POST['apt'];

//MySqli Select Query
$results = $mysqli->query (SELECT * FROM waitlist");

echo "<table border=1>";
echo "<th>unit#</th>";
echo "<th>resident name</th>";
echo "<th>movein date</th>";
echo "<th>effect date</th>";
echo "<th>expire date</th>";
echo "<th>days left</th>";
echo "<th colspan=3>recertification notification</th>";
echo "</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['apt'] . "</td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['moveindate'] . "</td>";
echo "<td>" . $row['effdate'] . "</td>";
echo "<td>" . $row['expdate'] . "</td>";
echo "<td>" . $row['daysleft'] . "</td>";
echo "<td>" . $row['90date'] . "</td>";
echo "<td>" . $row['60date'] . "</td>";
echo "<td>" . $row['30date'] . "</td>";
echo "</tr>";
}
echo "</table>";

// Free result set
mysqli_free_result($result);
} else{
echo "No records matching your query were found.";
}
} else{
echo "ERROR: unable to execute $sql. " . mysqli_error($link);
}

$mysqli -> close();
?>

</body></html>
---------------------------------------------------------------
here is result:

<html><body>
<hr>
<center><b><font size=+2> 515 Certification Expiration Report</font><br>06/22/2020 - 06/22/2021<p>

<hr>
<?php

// Report all PHP errors
error_reporting(E_ALL);

// Include config file
require_once "getprerentdb.php";

$apt = $_POST['apt'];

//MySqli Select Query
$results = $mysqli->query (SELECT * FROM waitlist");

echo "<table border=1>";
echo "<th>unit#</th>";
echo "<th>resident name</th>";
echo "<th>movein date</th>";
echo "<th>effect date</th>";
echo "<th>expire date</th>";
echo "<th>days left</th>";
echo "<th colspan=3>recertification notification</th>";
echo "</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['apt'] . "</td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['moveindate'] . "</td>";
echo "<td>" . $row['effdate'] . "</td>";
echo "<td>" . $row['expdate'] . "</td>";
echo "<td>" . $row['daysleft'] . "</td>";
echo "<td>" . $row['90date'] . "</td>";
echo "<td>" . $row['60date'] . "</td>";
echo "<td>" . $row['30date'] . "</td>";
echo "</tr>";
}
echo "</table>";

// Free result set
mysqli_free_result($result);
} else{
echo "No records matching your query were found.";
}
} else{
echo "ERROR: unable to execute $sql. " . mysqli_error($link);
}

$mysqli -> close();
?>

</body></html>
 
Status
Not open for further replies.
Top