Skip to content
Permalink
Browse files

Added killed connection if fail MySQL connection!

  • Loading branch information...
SenorContento committed Feb 19, 2019
1 parent 2c6d9ca commit f3a53a91d1b7a2d94b2c5fab87b822a449a1cdad
Showing with 3 additions and 2 deletions.
  1. +3 −2 assignments/MySQL/index.php
@@ -49,7 +49,8 @@ public function testConnection() {
$return_response = $this->connectMySQL();
if(gettype($return_response) === "string") {
print("<p>Connection to MySQL Failed: " . $return_response . "!!!</p>");
print("<p>Connection to MySQL Failed: " . $return_response . "! Not Attempting Connection!!!</p>");
die();
} else {
print("<p>Connected to MySQL Successfully!!!</p>"); //object
}
@@ -237,7 +238,7 @@ public function printMySQLData() {
global $sqlCommands;
$conn = $sqlCommands->connectMySQL();
// This allows me to determine if table is empty
// This allows me to determine if table is empty (or even exists)
$sql = "SELECT id FROM Assignment5 LIMIT 1";
$tableExists = false;
foreach ($conn->query($sql) as $row) {

1 comment on commit f3a53a9

@SenorContento

This comment has been minimized.

Copy link
Owner Author

commented on f3a53a9 Feb 28, 2019

I linked to the source code instead of a live page on this particular assignment as this code contains a XSS bug that I did not want to be live once I fixed it in the main code. This code contains a security hole, so do not use it without fixing the security hole first. More information can be found at this Github issue #2.

Please sign in to comment.
You can’t perform that action at this time.