New user asks for help with connect func tion.

New user asks for help with connect func tion.

am 14.02.2006 19:15:22 von wesmith

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:
============================================================ ==
$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@m.gmane.org

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

am 15.02.2006 02:10:35 von oceanare pte ltd

Hi,

wesmith@athensacademy.org wrote:

> The simple connection script I am using is as follows:
> ============================================================ ==
> > $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@m.gmane.org

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

am 15.02.2006 03:31:15 von Daniel da Veiga

On 2/14/06, wesmith@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
> > $conn =3D mysql_connect("LocalHost", "wesmith", "my password");
> echo $conn;
> ?>
> ==================== =====
==================== =====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@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@m.gmane.org

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

am 15.02.2006 04:18:54 von Captain Webber

This is how I do it!

--------------------------------------


Connect Test



$conn = mysql_connect( "localhost", "user", "password", TRUE );
if (!$conn) {
die( 'Could not connect: ' . mysql_error() );
}
echo $conn;
?>



-----Original Message-----
From: wesmith@athensacademy.org [mailto:wesmith@athensacademy.org]
Sent: Tuesday, February 14, 2006 1:15 PM
To: win32@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:
============================================================ ==
$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@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@m.gmane.org

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

am 15.02.2006 14:00:25 von Daniel da Veiga

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

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

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

am 15.02.2006 15:44:53 von Lawson Cronlund

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@vrtinc.com
+1(480)308-0641 (Voice)
+1(602)996-0376 (Fax)


-----Original Message-----
From: wesmith@athensacademy.org [mailto:wesmith@athensacademy.org]
Sent: Tuesday, February 14, 2006 11:15 AM
To: win32@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:
============================================================ ==
$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@vrtinc.com


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org