mysql - php warning when logging in website folder by cpanel -


i writing php script in cpanel. when access website folder (e.g. www.bbbbbb.com/folder/) give warning that.

warning: mysqli::mysqli() [mysqli.mysqli]: (hy000/2005): unknown mysql server host    'host07.portalwebhosting' (1) in /home/restaur/public_html/restaurant/variables/variables.php on line 7  warning: mysqli::set_charset() [mysqli.set-charset]: couldn't fetch mysqli in /home/restaur/public_html/restaurant/includes/connect_database.php on line 3  warning: mysqli::stmt_init() [mysqli.stmt-init]: couldn't fetch mysqli in /home/restaur/public_html/restaurant/includes/login_form.php on line 45  fatal error: call member function prepare() on non-object in /home/restaur/public_html/restaurant/includes/login_form.php on line 46 

and use default account admin access, gives me same result.

and here php coding

<?php // database configuration $host ="host07.portalwebhosting.com"; $user ="user"; $pass ="password"; $database = "monkey"; $connect = new mysqli($host, $user, $pass,$database) or die("error :    ".mysql_error());  // access key access api $access_key = "12345";?> 

check connection string or may need try port

$connection = new mysqli("host", "user", "pwd", "db", "3306"); 

no need change port 3306 default why use die("error : ".mysql_error()); use mysqli


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -