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

Connect to a mysql Database using php

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Watch

adam_uk

Established Member
Impact
20
PHP:
<?

$username = "username";
$password ="password";
$db = "db";

$conn = mysql_connect("localhost", "$username", "$password") or die(mysql_error());

mysql_select_db("$db", $conn) or die (mysql_error());


?>

Once you have php,mysql working you can add this to a php file to use the database

you may also need other tools such as phpmyadmin www.phpmyadmin.net to help generate the mysql queries and make/delete/edit/change databases
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Nice one! That was a definite needed code snippet around here. ... Thanks for sharing. :D
 
0
Close
:)

surprised it wasnt already here
 
0
Close
I am saving this page in my "Cool Sites" guide :D, cool reference if your in a hurry.
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Filters for activity feeds
Your news feed, Latest activity, and the activity tab on profiles now have filter buttons: All, Posts, Quick replies, and Other. Your...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back