Re: MSSQL again
| From: | Stephen | Date: | Sat, 10 May 2003 10:58:22 +0000 |
| Subject: | Re: MSSQL again | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-19851@lists.php.net to get a copy of this message | ||
A small thing that will REALLY help improve the messages when things go
wrong.
Instead of
mysql_connect ('localhost', 'MY-user-name', 'my-user-password')
or die ('da bd cudn b connected 2 .... ');
Try using
mysql_connect ('localhost', 'MY-user-name', 'my-user-password')
or die ('There was an error while attempting to connect to the database
server. MySQL Said: '.MySQL_error() );
The function MySQL_error(); tells you exactly why your query failed, and can
be used with most MySQL Query commands. It is an invaluable tool to use, and
is great for debugging. For example, if you use it with MySQL_Query() you
can find out why your query failed (such as an error in your command code
layout!)
Stephen
----- Original Message -----
From: "toby z" <blue_myth_1@yahoo.com>
To: "Peter Misun" <misun@microstep-mis.sk>; <php-windows@lists.php.net>
Sent: Saturday, May 10, 2003 11:54 AM
Subject: Re: [PHP-WIN] MSSQL again
> heres how i connect :
>
>
>
>
> <?php
>
>
> mysql_connect ('localhost', 'MY-user-name', 'my-user-password')
> or die ('da bd cudn b connected 2 .... ');
>
>
>
>
> mysql_select_db ('my-database-name')
> or die ('cudn find da god dammed db :P ');
>
>
>
> ?>
>
>
>
> hope this helps
>
> good luck
>
> toby
>
> --- Peter Misun <misun@microstep-mis.sk> wrote: >
> > on page:
> > http://www.php.net/manual/en/function.mssql-connect.php
> > is written:
> >
> > int mssql_connect ( [string servername [, string username [,
> > string password]]])
> > ...
> > The servername argument has to be a valid servername that is
> > defined in the 'interfaces' file.
> >
> > what is 'interfaces' file ? ( I'm using windows2000)
> > how to set it?
> >
> > 5o
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> __________________________________________________
> Yahoo! Plus
> For a better Internet experience
> http://www.yahoo.co.uk/btoffer
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>