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/win32?unsub=gcdmw-win32 [at] m.gmane.org
wesmith [ Di, 14 Februar 2006 19:15 ] [ ID #1187581 ]

Re: New user asks for help with connect func tion.

Hi,

wesmith [at] athensacademy.org wrote:

> 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.
>
I do not wonder. 'conn' is an internal representation o the connection.
It is nothing a human could read.

You must create SQL statements, send them over to the server using
'conn' and then display the results returned.

Just study the MySQL documentation.

Erich

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32 [at] m.gmane.org
oceanare pte ltd [ Mi, 15 Februar 2006 02:10 ] [ ID #1189301 ]

Re: New user asks for help with connect func tion.

On 2/14/06, wesmith [at] athensacademy.org <wesmith [at] athensacademy.org> wrote:
> I would appreciate any assistance.
>
> I have MySQL 4.0.21 and Apache 2.0.52 and PHP 5.0.2 newly installed on mm=
y
> 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:
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> <?php
> $conn =3D mysql_connect("LocalHost", "wesmith", "my password");
> echo $conn;
> ?>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> I saved this script as mysqlconnect.php.
> When I access the script with my web browser I expect to see..
> Resource id #1
>

You're getting the same result as any of us would get with your
script, conn is an internal object, it shouldn't answer your echo
request. If you got no errors, congratulations, you've connected, now
what?! MySQL must know what to do...

> 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.
>

Take a look at the manual and try some scripts that do more than
connect, and ask back in case you get any error. Good luck.

> 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/win32?unsub=3Ddanieldaveiga [at] gma=
il.com
>
>


--
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/win32?unsub=3Dgcdmw-win32 [at] m.gmane.org
Daniel da Veiga [ Mi, 15 Februar 2006 03:31 ] [ ID #1189302 ]

RE: New user asks for help with connect func tion.

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: wesmith [at] athensacademy.org [mailto:wesmith [at] athensacademy.org]
Sent: Tuesday, February 14, 2006 1:15 PM
To: win32 [at] lists.mysql.com
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/win32?unsub=captain_webber [at] hotmail.co m


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32 [at] m.gmane.org
Captain Webber [ Mi, 15 Februar 2006 04:18 ] [ ID #1189303 ]

Re: New user asks for help with connect func tion.

OK, so, this is how I use it, specially to exploit free servers
(sshhh, don't tell anyone).

<?php
$link =3D mysql_connect('host', 'user', 'password');
$db_list =3D mysql_list_dbs($link);

while ($row =3D mysql_fetch_object($db_list)) {
echo $row->Database . "\n";
$status =3D explode(' ', mysql_stat($link));
print_r($status);
printf("MySQL server version: %s\n", mysql_get_server_info());
}
?>


On 2/15/06, Captain Webber <captain_webber [at] hotmail.com> wrote:
> This is how I do it!
>
> --------------------------------------
> <html>
> <head>
> <title> Connect Test </title>
> </head>
> <body>
>
> <?php
> $conn =3D mysql_connect( "localhost", "user", "password", TRUE );
> if (!$conn) {
> die( 'Could not connect: ' . mysql_error() );
> }
> echo $conn;
> ?>
> </body>
> </html>
>
> -----Original Message-----
> From: wesmith [at] athensacademy.org [mailto:wesmith [at] athensacademy.org]
> Sent: Tuesday, February 14, 2006 1:15 PM
> To: win32 [at] lists.mysql.com
> 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 mm=
y
> 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:
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> <?php
> $conn =3D mysql_connect("LocalHost", "wesmith", "my password"); echo $con=
n; ?>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> 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/win32?unsub=3Dcaptain_webber [at] hotmail. com
>
>
> --
> MySQL Windows Mailing List
> For list archives: http://lists.mysql.com/win32
> To unsubscribe: http://lists.mysql.com/win32?unsub=3Ddanieldaveiga [at] gma=
il.com
>
>


--
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/win32?unsub=3Dgcdmw-win32 [at] m.gmane.org
Daniel da Veiga [ Mi, 15 Februar 2006 14:00 ] [ ID #1189304 ]

RE: New user asks for help with connect func tion.

Wes,

I'm not sure whether this is related to your problem but it sounds like the
problem that I had after installing Apache2 and PHP5.

The installation routine that I used apparently identified the php5 dll in
the "httpd.conf" file as:

LoadModule php5_module "c:/php/php5apache.dll

But it needs to be:

LoadModule php5_module "c:/php/php5apache2.dll

Note the "2" in the dll name.

Hope this helps.




Lawson
lawson [at] vrtinc.com
+1(480)308-0641 (Voice)
+1(602)996-0376 (Fax)


-----Original Message-----
From: wesmith [at] athensacademy.org [mailto:wesmith [at] athensacademy.org]
Sent: Tuesday, February 14, 2006 11:15 AM
To: win32 [at] lists.mysql.com
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/win32?unsub=lawson [at] vrtinc.com


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32 [at] m.gmane.org
Lawson Cronlund [ Mi, 15 Februar 2006 15:44 ] [ ID #1189305 ]
Datenbanken » gmane.comp.db.mysql.windows » New user asks for help with connect func tion.

Vorheriges Thema: mysql on 64bit
Nächstes Thema: INNODB Database Performance