PHP » PYTHON |
login |
register |
about
|
PYTHON mysql_connect
is this article helpful?
|
Python replacement for PHP's mysql_connect
[
edit
| history
]
import MySQLdb connection = MySQLdb.connect(user='DB_USER', passwd='DB_PASS', db='DB_NAME') cursor = connection.cursor() mysql_connect(PHP 4, PHP 5) mysql_connect — Open a connection to a MySQL Server Description
resource mysql_connect
([ string $server= ini_get("mysql.default_host")
[, string $username= ini_get("mysql.default_user")
[, string $password= ini_get("mysql.default_password")
[, bool $new_link= false
[, int $client_flags= 0
]]]]] )
Opens or reuses a connection to a MySQL server. Parameters
Return ValuesReturns a MySQL link identifier on success, or FALSE on failure. Changelog
Examples
Example #1 mysql_connect() example
<?php
Example #2 mysql_connect() example using hostname:port syntax
<?php
Example #3 mysql_connect() example using ":/path/to/socket" syntax
<?php
Notes
See Also
|
more
Recently updated
more
Most requested
more
Last requests
|