RE: New user asks for help with connect func tion.
"Captain Webber" <[email protected]>
| Newsgroups | gmane.comp.db.mysql.windows |
|---|---|
| Message-ID | <[email protected]> |
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]