database

how to add users in database

in others hosting service
there is a option to
users in database

On InfinityFree, you cannot create custom database users. All scripts on your website must use your main account credentials. You need to upgrade your account to get that option.

then how to use all scripts to my main account
means without adding user to database

without adding user to databse, i could not sign in

@timung said:
then how to use all scripts to my main account
means without adding user to database

without adding user to databse, i could not sign in

You can use your hosting account username and password to connect to MySQL from your script. All scripts on your account would use the same credentials.

sorry not working, i tried to login with my hosting username & password, it shows incorrect

@timung said:
sorry not working, i tried to login with my hosting username & password, it shows incorrect

What shows incorrect where? I can’t do anything with vague interpretations of error messages. Can you tell me the account username, path to the configuration file and and page which uses the database connection?

admin login page http://lunjir.epizy.com/php_web_services/

database connection

<?php
    error_reporting(0);
 		 ob_start();
    session_start();
 
 	header("Content-Type: text/html;charset=UTF-8");
	
	
		if($_SERVER['HTTP_HOST']=="localhost" or $_SERVER['HTTP_HOST']=="192.168.1.125")
		{	
			//local  

				 DEFINE ('DB_USER', 'root');
				 DEFINE ('DB_PASSWORD', '');
				 DEFINE ('DB_HOST', 'localhost'); //host name depends on server
				 DEFINE ('DB_NAME', 'online_mp3_new');
		}
		else
		{
			//local live 

		 	 DEFINE ('DB_USER', '');
			 DEFINE ('DB_PASSWORD', '');
			 DEFINE ('DB_HOST', 'localhost'); //host name depends on server
			 DEFINE ('DB_NAME', '');
		}

	
	$mysqli =mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME);

	if ($mysqli->connect_errno) 
	{
    	echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
	}

	mysqli_query($mysqli,"SET NAMES 'utf8'");	 



	//Settings
	$setting_qry="SELECT * FROM tbl_settings where id='1'";
    $setting_result=mysqli_query($mysqli,$setting_qry);
    $settings_details=mysqli_fetch_assoc($setting_result);

    define("APP_NAME",$settings_details['app_name']);
    define("APP_LOGO",$settings_details['app_logo']);

    define("API_LATEST_LIMIT",$settings_details['api_latest_limit']);
    define("API_CAT_ORDER_BY",$settings_details['api_cat_order_by']);
    define("API_CAT_POST_ORDER_BY",$settings_details['api_cat_post_order_by']);
    define("API_ALL_VIDEO_ORDER_BY",$settings_details['api_all_order_by']);
    

    //Profile
    if(isset($_SESSION['id']))
    {
    	$profile_qry="SELECT * FROM tbl_admin where id='".$_SESSION['id']."'";
	    $profile_result=mysqli_query($mysqli,$profile_qry);
	    $profile_details=mysqli_fetch_assoc($profile_result);

	    define("PROFILE_IMG",$profile_details['image']);
    }
    
	
 
?> 

my username epiz_20735987

when i goto login page http://lunjir.epizy.com/php_web_services/

i should be able to login with username ADMIN password ADMIN

but i could not login because i cant add users to database on free hosting

so how to login without adding user to database,
and you said i can login with my hosting account username and password to connect to MySQL

but how,

my script need to add user to database

i tried, freehosting.com
there i can add user to database
so it is working fine, i can login also

but there server is down, now also cpanel not opening

so how to login without adding user to database

Your database password is not correct. Note that you need to use the hosting account password, not the client area password.