简体   繁体   中英

Using JDBC Java string, to connect to mysql database in PHP

what i have is java application, that connects to the database. I have username, password and connection url string. Url string is like:

jdbc:mysql://example.ddns.net:3306/something?useSSL=false

Is there a way to use this in order to connect to this mysql database in php? Using something like mysqli?

$conn = new mysqli($servername, $username, $password);

you can find you answer on:

https://www.w3schools.com/php/php_mysql_connect.asp

<?php
$servername = "example.ddns.net";
$username = "username";
$password = "password";

// Create connection
$conn = new mysqli($servername, $username, $password);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 
echo "Connected successfully";
?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM