This question already has an answer here:
Ive searched on here and various other places and I just cannot find the answer to solve this problem. I just bought new hosting and am trying to move my sites. I am getting the error below.
- Warning: mysqli_select_db() expects parameter 1 to be mysqli, string given in
- /home4/purefic/public_html/demo/mytcg/settings.php on line 230
-
- Warning: mysqli_error() expects exactly 1 parameter, 0 given in
- /home4/purefic/public_html/demo/mytcg/settings.php on line 231
- DATABASE_CONNECT_ERROR
And this is the coding I have on my settings page (originally working just fine on my old host I had everything as mysql and not mysqli like my research seemed to tell me to change to but as you can see it didnt work)
- $users = array($user => md5($pass));
- $salt = substr(md5(date("F")), 8);
-
- $connect = mysqli_connect("$db_server", "$db_user", "$db_password")
- or die( DATABASE_CONNECT_ERROR . mysqli_error() );
- mysqli_select_db("$db_database" , $connect)
- or die( DATABASE_CONNECT_ERROR . mysqli_error() );
-
- function CleanUp($data) {
- $data = trim(htmlentities(strip_tags($data)));
- return $data;
- }
-
- function escape_sql($sql) {
- if (get_magic_quotes_gpc()) $sql = stripslashes($sql);
- return mysqli_real_escape_string($sql);
- }
- ?>
</div>