Skip to content

Commit

Permalink
Add Port option for MySql (librespeed#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
kristanbbc authored Jun 11, 2020
1 parent 6fbe21f commit 9efae7c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion results/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function format($d){
$conn=null; $q=null;
$ispinfo=null; $dl=null; $ul=null; $ping=null; $jit=null;
if($db_type=="mysql"){
$conn = new mysqli($MySql_hostname, $MySql_username, $MySql_password, $MySql_databasename);
$conn = new mysqli($MySql_hostname, $MySql_username, $MySql_password, $MySql_databasename, $MySql_port);
$q = $conn->prepare("select ispinfo,dl,ul,ping,jitter from speedtest_users where id=?");
$q->bind_param("i",$id);
$q->execute();
Expand Down
2 changes: 1 addition & 1 deletion results/stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
}else{
$conn=null;
if($db_type=="mysql"){
$conn = new mysqli($MySql_hostname, $MySql_username, $MySql_password, $MySql_databasename);
$conn = new mysqli($MySql_hostname, $MySql_username, $MySql_password, $MySql_databasename, $MySql_port);
}else if($db_type=="sqlite"){
$conn = new PDO("sqlite:$Sqlite_db_file");
} else if($db_type=="postgresql"){
Expand Down
2 changes: 1 addition & 1 deletion results/telemetry.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
header('Pragma: no-cache');

if($db_type=="mysql"){
$conn = new mysqli($MySql_hostname, $MySql_username, $MySql_password, $MySql_databasename) or die("1");
$conn = new mysqli($MySql_hostname, $MySql_username, $MySql_password, $MySql_databasename, $MySql_port) or die("1");
$stmt = $conn->prepare("INSERT INTO speedtest_users (ip,ispinfo,extra,ua,lang,dl,ul,ping,jitter,log) VALUES (?,?,?,?,?,?,?,?,?,?)") or die("2");
$stmt->bind_param("ssssssssss",$ip,$ispinfo,$extra,$ua,$lang,$dl,$ul,$ping,$jitter,$log) or die("3");
$stmt->execute() or die("4");
Expand Down
3 changes: 2 additions & 1 deletion results/telemetry_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
$MySql_password="PASSWORD";
$MySql_hostname="DB_HOSTNAME";
$MySql_databasename="DB_NAME";
$MySql_port="3306";

// Postgresql settings
$PostgreSql_username="USERNAME";
Expand All @@ -22,4 +23,4 @@


//IMPORTANT: DO NOT ADD ANYTHING BELOW THIS PHP CLOSING TAG, NOT EVEN EMPTY LINES!
?>
?>

0 comments on commit 9efae7c

Please sign in to comment.