|
Posted by Rik on 06/06/06 21:51
Frances wrote:
> this seems pretty straight-forward.. got this code
>
> $link = mysql_connect('localhost:3306', '<uid>', '<pswd>');
Do you need the port here? And I assume your username & password are
correct?
What happens if you:
$link = mysql_connect('localhost', 'your_username', 'your_password');
If you want to connect by TCP/IP use 127.0.0.1 instead of localhost.
> now on top of pg mentioned above, there this description:
>
> resource mysql_connect ( [string server [, string username [, string
> password [, bool new_link [, int client_flags]]]]] )
>
> what does 'resource' refer to here pls...
www.php.net > manual > types > resource:
http://www.php.net/manual/en/language.types.resource.php
A resource is a special variable, holding a reference to an external
resource.
> and where to do specify what
> db to connect to... (in java you put db-name in same line where you
> make the connection..)
mysql_select_db('db_name', $link);
> (and don't you need a driver to connect, I use a JDBC driver to
> connect w/Java..)
Mostly it's enabled by default in PHP4, PHP5 it's not, details:
http://www.php.net/manual/en/ref.mysql.php
Grtz
--
Rik Wasmus
[Back to original message]
|