> $link = mysql_connect("remote host", "mysql_user", "mysql_password") 
> or die("Could not connect: " . mysql_error());
>
> how is that ???
> do i have to put the same function ?
>
> or is diferent?

Basically what they are saying is 
$link is your connection to your database.
Remote_host mysql_user and mysql_password are your login variables
(which you should have defined in your db connection function somewhere
else - preferably where noone can see it) or die means if it don't work
for some reason print out the mysql_error. Mysql_error is a built in
function of php and is useful to display problems...

Here is a typical function I use to connect to a DB.
function db_connect()
{
   $LocalHost = "localhost";
   $User = "root";
   $Password = "password";
   $DBName = "database_name";
   $result = @mysql_connect("$LocalHost", "$User", "$Password")or
die("Could not connect to the database"); 
   if (!$result)
      return false;
   if ([EMAIL PROTECTED]("$DBName"))
      return false;

   return $result;
}

Obviously change the variables $localhost (with your servername) $user
(your username) password (you guessed it your password) and $DBName with
the name of your database.

Then when you want to connect to the DB in php you just call 
db_connect();

The guys are right though for this level of questions you should read
the manual all of this is explained in greater detail than we can go
into.

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159





> -----Original Message-----
> From: Luis A [mailto:[EMAIL PROTECTED] 
> Sent: 26. helmikuuta 2003 1:52
> To: [EMAIL PROTECTED]
> Subject: [PHP] to Bryan Lipscy Re: [PHP] how___??
> 
> 
> MEN I DONT HAVE INTERNET ACCESS
> 
> thanks anyway
> 
> if some one else can help m e please????
> ----- Original Message -----
> From: "Bryan Lipscy" <[EMAIL PROTECTED]>
> To: "'Luis A'" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Tuesday, February 25, 2003 6:16 PM
> Subject: RE: [PHP] how___??
> 
> 
> > Please read the online documentation at http://www.php.net
> >
> > Also read through examples at 
> > http://www.zend.com/tips/tips.php?CID=113
> >
> > And before you ask another question please read: 
> > http://www.catb.org/~esr/faqs/smart-questions.html
> >
> > Each of these pages may be translated at http://babel.altavista.com
> >
> > Bryan
> >
> >
> > -----Original Message-----
> > From: Luis A [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, February 25, 2003 2:16 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] how___??
> >
> >
> > i need to do this
> >
> >
> > $link = mysql_connect("remote host", "mysql_user", 
> "mysql_password") 
> > or die("Could not connect: " . mysql_error());
> >
> > how is that ???
> > do i have to put the same function ?
> >
> > or is diferent?
> >
> > ----- Original Message -----
> > From: "Bryan Lipscy" <[EMAIL PROTECTED]>
> > To: "'Luis A'" <[EMAIL PROTECTED]>;
> > <[EMAIL PROTECTED]>
> > Sent: Tuesday, February 25, 2003 4:57 PM
> > Subject: RE: [PHP] how___??
> >
> >
> > > RTM first please: 
> > > http://www.php.net/manual/en/function.mysql-connect.php
> > >
> > > $link = mysql_connect("localhost", "mysql_user", 
> "mysql_password") 
> > > or die("Could not connect: " . mysql_error());
> > >
> > > Replace localhost with the hostname of your mysql server.
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: Luis A [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, February 25, 2003 1:34 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] how___??
> > >
> > >
> > > hlelooooooww>)
> > >
> > > i need some one can help me please?
> > >
> > > i need to make this quine of conection
> > >
> > > for example
> > >
> > > i want to connect to a remote mysql  server
> > >
> > > i realy apreciate if some one can help me
> > >
> > > please?
> > >
> > > >)
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to