How to Connect to a Mysql database using PHP?
Posted
by Karthik
on Stack Overflow
See other posts from Stack Overflow
or by Karthik
Published on 2010-04-23T19:48:37Z
Indexed on
2010/04/23
20:03 UTC
Read the original article
Hit count: 278
<?php
mysql_connect("localhost", "username", "password") or die(mysql_error());
echo "Connected to MySQL<br />";
?>
This is the code I am using to check if I am able to connect to Mysql.
I am having problem connecting using this code. Should I change localhost to the name of the website?
I tried ("www.abc.com","login username", "password") even this is not working.
© Stack Overflow or respective owner