How to fetch single value from database in php

  1. Step 1: Connection with Database. The dbConn.php file is used to make a connection with the database. dbConn.php.
  2. Step 2: Fetch or retrieve data from Database. This all_records.php file is used to display records from the database. Use where clause for fetching single data and define the value. all_records.php.
          <?php $userid = "sdfjkds83748";
	$sqlp = "SELECT * FROM `login_user` WHERE `username`='$userid '";
	 $result = mysqli_query($connection, $sqlp);
	 $row = mysqli_fetch_assoc($result);
        $usermobileno = $row['usermobileno']; echo $usermobileno;?>
Sometimes we need only single value from database, so using this code you can gate any value from any database table.