Hi, I just loaded new os (windows7 professional) to my machine along with later version of xampp and when I run php files I get php code. I should get a report yet I get the result shown below. My file is .php and I am running it through an html file. I use firefox. I'm running xampp-win32-7.3.2-0-VC15 although I have tried 2 other versions. Apache and mysql are running. I could use some advice. thanks! here is the code: <html><body> Certification Expiration Report<p> <hr> <?php //Open a new connection to the MySQL server require_once "hoappsdb-connect.php"; //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 "</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 "</tr>"; } echo "</table>"; // Free result set mysqli_free_result($result); } else{ echo "No records matching your query were found."; } } else{ echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); } // Close connection mysqli_close($link); ?> </body></html> here is the result: 515 Certification Expiration Report 06/22/2020 - 06/22/2021 query (SELECT * FROM waitlist"); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; while($row = mysql_fetch_array($result)) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo " unit# resident name movein date effect date expire date days left recertification notification " . $row['apt'] . " " . $row['name'] . " " . $row['moveindate'] . " " . $row['effdate'] . " " . $row['expdate'] . " " . $row['daysleft'] . " " . $row['90date'] . " " . $row['60date'] . " " . $row['30date'] . " "; // Free result set mysqli_free_result($result); } else{ echo "No records matching your query were found."; } } else{ echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); } // Close connection mysqli_close($link); ?> Code (markup):
First of all, what do you mean by this? You should run it through the xampp server. So can you please confirm that your file is in XAMPPs htdocs folder and you are running it via localhost/path/to/file.php in your browser
If you are using PHP code inside html file, then read this https://stackoverflow.com/questions/22853669/how-can-i-run-a-php-script-inside-a-html-file