What connection string can I use to connect to mySQL from php?

You can use the MYSQL connection string for PHP as shown below. Please be sure to replace the database username (dbuser), password, and database name (dbname). The hostname should be localhost. Please note: iPowerWeb Technical Support does not provide assistance with web scripting.



$username = "dbuser";
$password = "password";
$hostname = "localhost";
$dbh = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL");
mysql_select_db ("dbname");

  • 1 Usuários acharam útil
Esta resposta lhe foi útil?

Artigos Relacionados

How can I manage my mySQL database?

If you are on Linux OS, you may manage your mySQL database from your shell prompt using" "mysql"...

Can I use a Datasource or DSN to connect to my database?

Datasources/DSN's are used to transfer information to and from a database, such as Access or SQL...