Can"t get a MySQL connection either

Can"t get a MySQL connection either

am 14.02.2007 05:07:40 von Vince Bravdica

------=_NextPart_000_0B6D_01C74FB2.FF118620
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

This is posted by another user and I am also trying for answers at the
MySql-PHP list:

When entering the following, I do not get a response in any fashion from the
developmental server on my system, just a blank page. Any ideas how I can
complete the connection?


MySql


$dbServer='localhost';
$dbUser='root';
$dbPass='';
$dbName='test';
$link = mysql_connect("$dbServer", "$dbUser", "$dbPass") or die("Could not
connect");
print "Connected Successfully
";
mysql_select_db("$dbName") or die("Could not select database");
print "Database selected successfully
";
mysql_close($link);
?>




Vince Bravdica
President
Virtual Web Resources
www.vwebr.net


_____

I am using the free version of SPAMfighter for private users.
It has removed 2457 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!


------=_NextPart_000_0B6D_01C74FB2.FF118620--

Re: Can"t get a MySQL connection either

am 14.02.2007 15:29:53 von dpgirago

--=_alternative 004F9F8986257282_=
Content-Type: text/plain; charset="us-ascii"

| This is posted by another user and I am also trying for answers at the
|MySql-PHP list:
|
| When entering the following, I do not get a response in any fashion from
the
| developmental server on my system, just a blank page. Any ideas how I
can
| complete the connection?
|
|
| MySql
|
|
| | $dbServer='localhost';
| $dbUser='root';
| $dbPass='';
| $dbName='test';
| $link = mysql_connect("$dbServer", "$dbUser", "$dbPass") or die("Could
not
| connect");
| print "Connected Successfully
";
| mysql_select_db("$dbName") or die("Could not select database");
| print "Database selected successfully
";
| mysql_close($link);
| ?>
|
|
|
| Vince Bravdica

Vince,

Maybe add mysql_error() inside your die statment after trying to connect:
$link = mysql_connect("$dbServer", "$dbUser", "$dbPass") or die("Could not
connect" . mysql_error());
--=_alternative 004F9F8986257282_=--

Re: Can"t get a MySQL connection either

am 15.02.2007 06:11:01 von Michael Louie Loria

--------------enig861C3836767AD09910A5A652
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

> This is posted by another user and I am also trying for answers at the
> MySql-PHP list:
>
> When entering the following, I do not get a response in any fashion
> from the developmental server on my system, just a blank page. Any
> ideas how I can complete the connection?

>
> MySql
>
>
> > $dbServer=3D'localhost';
> $dbUser=3D'root';
> $dbPass=3D'';
> $dbName=3D'test';
> $link =3D mysql_connect("$dbServer", "$dbUser", "$dbPass") or die("Coul=
d
> not connect");
> print "Connected Successfully
";
> mysql_select_db("$dbName") or die("Could not select database");
> print "Database selected successfully
";
> mysql_close($link);
> ?>
>
>

1. $link =3D mysql_connect($dbServer, $dbUser, $dbPass) or die("Could not=

connect");

2. mysql_select_db($dbName) or die("Could not select database");

I removed the characters " because those are variables.



--------------enig861C3836767AD09910A5A652
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)

iQEVAwUBRdPrZbXBHi2y3jwfAQppNQf/YuPJB1k7TziPzU0ktvwqKD8xb3d5 5sMY
+AN6GisjV6QulqR9x3jEyLEbZ2yopIdWYgeOB15SBKXTwr9j/EdISrsX8f8C RQW4
cGRyjn30VPdEAYyk8HzGiG0hj/cmses1405fqAsz6JC7CGURI0vvICNPQbjx yyjY
cQ0/f5IlpvKYEzBCuR1kIyq2xaumFn5U0iMvHgZzQy9QG1Dvtv9In99R0ZNl 0FxD
RYfuTnnsOX1CgLRH1lsQzsYuEk6wZdSErLdV353qBb1xl1rya4o614hELyb4 fjXT
bEJoHsmIq+9bwNxSseBQ9n2rj05P7r2d2cLFIia17jE0/VGFd/Ud/g==
=T/Qa
-----END PGP SIGNATURE-----

--------------enig861C3836767AD09910A5A652--