0
Good evening, everyone,
I am trying to connect my wordpress application to the remote database, so I can list users within the application.
I already tested some things between some researches, but I could not solve the problem yet.
Can anyone tell me what’s wrong with the code?
I’m using the following code:
<?php
define('hostname', 'http://thorpeinnovation.com/painfree/');
define('user', 'admin');
define('password', 'senha');
define('databaseName', 'osmoc913_wp786');
$connect = mysqli_connect(hostname, user, password, databaseName, 80) or trigger_error(mysql_error(),E_USER_ERROR);
$query = sprintf("SELECT name FROM wp2n_frm_items");
$dados = mysql_query($query, $connect) or die(mysql_error());
$linha = mysql_fetch_assoc($dados);
$total = mysql_num_rows($dados);
?>
<html>
<head>
<title>Exemplo</title>
</head>
<body>
<?php
if($total > 0) {
do {
?>
<p><?=$linha['name']?> </p>
<?php
}while($linha = mysql_fetch_assoc($dados));
// fim do if
}
?>
</body>
</html>
<?php
mysql_free_result($dados);
?>
And it’s returning these errors:
Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'https://thorpeinnovation.com/painfree/wp-content/plugins/wp-phpmyadmin-extension/lib/phpMyAdmin_nwuP' (0) in /home/osmoc913/public_html/thorpeinnovation.com/painfree/wp-content/plugins/insert-php-code-snippet/shortcode-handler.php(65) : eval()'d code on line 6
Fatal error: in /home/osmoc913/public_html/thorpeinnovation.com/painfree/wp-content/plugins/insert-php-code-snippet/shortcode-handler.php(65) : eval()'d code on line 6
Now you changed the error, it says access is denied. Warning: mysqli_connect(): (28000/1045): Access denied for user 'admin'@'50.116.87.234' (using password: YES) in /home/osmoc913/public_html/thorpeinnovation.com/painfree/wp-content/plugins/Insert-php-code-snippet/shortcode-Handler.php(65) : Eval(code’d on line 6
– Laura Regina
Incorrect password or user without permission to the database.
– Pedro Henrique
Look for a file called
wp-config.php
at the root of the server, it should contain your wordpress database data.– Pedro Henrique
I’m using Wordpress 5.1.1 in the web version. Can you tell me more precisely where this file is in the project? Because someone else commented on him before, and I still can’t find him.
– Laura Regina
At the root of your server, when connecting to the server by ftp you or should see a list of files where one of them is the
wp-config.php
or you should view a list with a folder calledpublic_html
orwww
, if you see any of these folders the file is probably inside the folder.– Pedro Henrique