Re: New user asks for help with connect func tion.
Daniel da Veiga <[email protected]>
| Newsgroups | gmane.comp.db.mysql.windows |
|---|---|
| Message-ID | <[email protected]> |
OK, so, this is how I use it, specially to exploit free servers
(sshhh, don't tell anyone).
<?php
$link = mysql_connect('host', 'user', 'password');
$db_list = mysql_list_dbs($link);
while ($row = mysql_fetch_object($db_list)) {
echo $row->Database . "\n";
$status = explode(' ', mysql_stat($link));
print_r($status);
printf("MySQL server version: %s\n", mysql_get_server_info());
}
?>
On 2/15/06, Captain Webber <[email protected]> wrote:
> This is how I do it!
>
> --------------------------------------
> <html>
> <head>
> <title> Connect Test </title>
> </head>
> <body>
>
> <?php
> $conn = mysql_connect( "localhost", "user", "password", TRUE );
> if (!$conn) {
> die( 'Could not connect: ' . mysql_error() );
> }
> echo $conn;
> ?>
> </body>
> </html>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> Sent: Tuesday, February 14, 2006 1:15 PM
> To: [email protected]
> Subject: New user asks for help with connect func tion.
>
> I would appreciate any assistance.
>
> I have MySQL 4.0.21 and Apache 2.0.52 and PHP 5.0.2 newly installed on mmy
> laptop.
>
> I am able to use PHP and Apache in my browser and see results.
>
> However, I am not successful when I attempt to connect to MySQL with PHP.
>
> The simple connection script I am using is as follows:
> ==============================================================
> <?php
> $conn = mysql_connect("LocalHost", "wesmith", "my password"); echo $conn; ?>
> =============================================================
>
> I saved this script as mysqlconnect.php.
> When I access the script with my web browser I expect to see..
> Resource id #1
>
> Instead I see nothing at all. No error message. Simply a blank screen.
>
> Note: I have been able to view other output from PHP with my browser that
> does not involve MySQL. I don't know what I am doing wrong.
>
> Any help would be appreciated.
>
> Wes smith
>
>
>
> --
> MySQL Windows Mailing List
> For list archives: http://lists.mysql.com/win32
> To unsubscribe:
> http://lists.mysql.com/[email protected]
>
>
> --
> MySQL Windows Mailing List
> For list archives: http://lists.mysql.com/win32
> To unsubscribe: http://lists.mysql.com/[email protected]
>
>
--
Daniel da Veiga
Computer Operator - RS - Brazil
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/IT/P/O d-? s:- a? C++$ UBLA++ P+ L++ E--- W+++$ N o+ K- w O M- V-
PS PE Y PGP- t+ 5 X+++ R+* tv b+ DI+++ D+ G+ e h+ r+ y++
------END GEEK CODE BLOCK------
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/[email protected]