Restore Firebird database with PHP - php

I did a backup
<?PHP
$host = 'LUIS-PC/3051';
$file = 'C:\sge\BANCO.FDB';
$username = 'SYSDBA';
$password = 'masterkey';
$resource_service_handle = ibase_service_attach ($host,$username,$password);
ibase_backup($resource_service_handle,$file,'C:\sge\bd.fbk');
ibase_service_detach ($resource_service_handle);
but the restore didn't work
$resource_service_handle = ibase_service_attach ($host,$username,$password);
ibase_restore($resource_service_handle, 'C:\sge\bd.fbk', 'C:\sge\abcde.fdb');
ibase_service_detach ($resource_service_handle);
There is no error message

Related

Retrieve data from Config. PHP file

Hello i have file in folder assets/includes/config.php
The file contains this data:
$db_host = 'localhost';
$db_name = 'xxxx';
$db_username = 'xxxx';
$db_password = 'xxxxx';
$site_url = 'https://xxxxx.xx/';
How can i echo this data in index.php so it would be visible for everybody ?
Thank you!
Just use echo before all code lines.
For example
echo $db_host = 'localhost';
echo $db_name = 'xxxx';
echo $db_username = 'xxxx';
echo $db_password = 'xxxxx';
echo $site_url = 'https://xxxxx.xx/';

mysql doesn't connect while using fopen

The code below doesn't connect:
$file_open = fopen("logindetails.txt","r");
if($file_open){
$user = fgets($file_open);
$pass = fgets($file_open);
$server = fgets($file_open);
}
echo "user: ",$user,"password: ",$pass,"server: ",$server;
#$db_handle = mysql_connect($server,$user,$pass);
but outputs:
user: root password: usbw server: localhost
logindetails.txt contains:
root
usbw
localhost
while this code connects:
$user = "root";
$pass = "usbw";
$server = "localhost";
echo "user: ",$user,"password: ",$pass,"server: ",$server;
#$db_handle = mysql_connect($server,$user,$pass);
I can't get this working and I can't guess why.
The variables you read with fgets in also contain linebreaks.
$user == "root\n";
$pass == "passw\n";
Which is why MySQL won't recognize them as valid.
So, you should either:
trim() them
instead use an INI file
better yet some config.php instead of a text file.

SQL ERROR [ mysqli ] Access denied for user 'abc'#'localhost' (using password: YES) [1045]

i am getting this error as i integrate this forum in my website i am new to this error his is my config.php i had made changes according to my database i am new to this i don't know why and what is this error.
<?php
$dbms = 'phpbb\\db\\driver\\mysqli';
$db host = 'localhost';
$dbport = '';
$dbname = 'abc_forum';
$dbuser = 'root',
$dbpasswd = '';
$table_prefix = '';
$phpbb_adm_relative_path ='adm/';
$acm_type = 'phpbb\\cache\\driver\\file';
#define('PHPBB_INSTALLED', true);
change $db host to $dbhost :
<?php
$dbms = 'phpbb\\db\\driver\\mysqli';
$dbhost = 'localhost';
$dbport = '';
$dbname = 'abc_forum';
$dbuser = 'root',
$dbpasswd = '';
$table_prefix = '';
$phpbb_adm_relative_path ='adm/';
$acm_type = 'phpbb\\cache\\driver\\file';
#define('PHPBB_INSTALLED', true);
The username and password are not valid. That is what this means. Ask your hosting provider for the correct credentials.
Keep it simple
$conn = new mysqli("DB_HOST","USERNAME","PASSWORD","DATABASE");

Please make sure you have specified a valid MySQL database name in 'include/config.php'

I've just downloaded cacti and I kept getting
FATAL: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'
This is what I have in include/config.php
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "root";
$database_password = "***";
$database_port = "3306";
$database_ssl = false;
What did I forget or did wrong ?

Unable to install PHP Nuke

I am using PHP nuke 7.6
In config.php i have changes the some code -
$dbhost = "localhost";
$dbuname = "root";
$dbpass = "";
$dbname = " phpnuke";
$prefix = "nuke";
$user_prefix = "nuke";
$dbtype = "MySQL";
$sitekey = "SdFk*fa28367-dm56w69.3a2fDS+e9";
$gfx_chk = 0;
$subscription_url = "";
$admin_file = "admin";
After complete the configuration i got the following message.
"There seems to be a problem with the MySQL server, sorry for the inconvenience. We should be back shortly."
Please help me to shutout this problem.
Thanks
Maybe the space before phpnuke in $dbname?
$dbname = " phpnuke";

Categories