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
?>
DOCAT Baby Diaper Bag, Cute Felt Diaper Caddy Organizer with Removable Shoulder Strap, Baby Basket Essentials for All Newborn Baby Products Nursery Basket (Beige)
₹999.00 (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.)NOVEL Baby Wet Wipes/Pack With Lid (Pack of 6-80 Sheet)
₹249.00 (as of February 5, 2026 02:41 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.)Teddyy Premium Baby Diapers S Size, Pant Style | Small (4-8 kg), 42 Pants | Butter Soft Feel | Anti-Rash with Aloe Vera &12 Hours Dryness Lock
₹389.00 (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.)Huggies Complete Comfort Wonder Pants | Pant Style Baby Diapers Large Size (L), 64 Count | India's Fastest Absorbing Diaper, Prevents Diaper Rash, Ideal for 9 to 14 Kgs
₹687.00 (as of February 5, 2026 02:41 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.)CITRODA Panda Night Lamp Silicone Touch Color Changing LED Rechargeable Night Light for Kids, Gifts for Girls & Boys | Cute Unisex Bedroom Decor Valentine Special Soft BPA-Free Nightlight
₹249.00 (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.)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.)