Re: Connection error
| From: | Jason Wong | Date: | Fri, 19 Apr 2002 08:33:27 +0000 |
| Subject: | Re: Connection error | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-18670@lists.php.net to get a copy of this message | ||
On Friday 19 April 2002 18:29, Ciprian Trofin wrote:
> > Bisexuality doubles the chance of getting a date.
>
> Hi All!
> In order to make my job easy, a choose the following approach:
>
> settings.php
> <?
> $dbserver = 'server';
> $dbname = 'name';
> $dbpass = 'password';
> ?>
>
> main_file.php
> <?
> include "settings.php";
> @mysql_connect($dbserver,$dbname,$dbpass) or die ("Error");
> ?>
>
> On the test machine (Windows 98, PHP Triad 221 - PHP 4.1.0) it
> works; when I put the project online, it doesn't (the "Error" message shows
> up). If I don't use this approach and, in main_file.php, I use the line:
> @mysql_connect('server','name','pass') or die
> ("Error")
> the sistem works.
>
> What's the problem ?
Always check for errors. Use mysql_error() to see what the error is. Also try
connecting to mysql from the shell/command-line.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
It isn't easy being the parent of a six-year-old. However, it's a pretty
small
price to pay for having somebody around the house who understands computers.
*/