Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Php with Mysql connection

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch
Impact
0
Hi,
I am looking for connection of PHP with mysql.
can any body send me coding of simple connection.
How to connect mysql.

Thanks...
 
Last edited by a moderator:
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
3
Close
Before you can access data in a database, you must create a connection to the database.
In PHP, this is done with the mysql_connect () function.
Syntax:
<?php
$con = mysql_connect(""localhost"",""peter"",""abc123"");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

// some code
?>?>
 
0
Close
PHP:
$dbname 	= '';
$dbuser 	= '';
$dbpass 	= '';
$dbhost 	= 'localhost';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or exit(mysql_error());
mysql_select_db($dbname, $conn) or exit(mysql_error());
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

New: watch any domain
You can now watch domains on NamePros. We check each one and notify you when something changes. Search for a domain and press Watch on...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back