If you want to develop any dynamic website/web application, must and should we need one database to store our dynamic content, mostly it will be MySQL, SQL or Oracle etc. So here we going to see how to connect mysql using PHP.
Find below code:
<?php
$dbhost = 'localhost'; //where your db residing
$dbuser = 'guest'; //db user name
$dbpass = 'guest123'; //db password
$conn = mysqli_connect($dbhost, $dbuser, $dbpass);
if(!$conn )
{
die('Could not connect: ' . mysqli_error());
}
echo 'Connected successfully';
mysqli_select_db($conn,'yourdbname'); //your db name
mysqli_close($conn); //close the connection
?>
MOM & SON Multipurpose Baby Feeding Pillow | Nursing Support Pillow for Breastfeeding & Bottle Feeding | Maternity Feedingpillow | Newborn Essentials | Adjustable Strap Feeding Pillow (0-12 Months)
Now retrieving the price.
(as of February 5, 2026 03:47 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)