$dbhost = ''; // MySQL server hostname
$dbuser = ''; // MySQL username
$dbpass = ''; // MySQL password
$dbname = ''; // MySQL database name
mysql_connect("$dbhost", "$dbuser") && mysql_select_db("$dbname")
or $failed = "Could not connect to database.";
"Jim Long" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> Just setting up a new db at a new domain and the connection script does
> not work.
> I've always been able to connect to a db using the following:
>
> <?php
>
> // Connect to the database server
> $dbcnx = @mysql_connect("localhost",
> "username", "password");
> if (!$dbcnx) {
> echo( "<P>Unable to connect to the " .
> "database server at this time.</P>" );
> exit();
> }
>
>
>
> The host support suggests the following:
>
> > Root as the mysql user and localhost as the server, unless you selected
remote mysql
> > connections from the web control panel.
>
> BTW: I DID select remote mysql. Should I unselect it?
>
> FMI (forgive my ignorance):
>
> What connection script should I use?
>
> Thanks So Much in Advance,
> Jim Long
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php