[svlug] Book recommendation

Brian J. Tarricone bjt23 at cornell.edu
Thu Jul 7 18:15:24 PDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bill Hubbard wrote:

> Where I got stuck was following an example in one of my books that 
> showed how to connect to a database.  The code was as follows (the 
> first two lines, anyway):
> 
> mysql_connect("localhost", "nobody", "password") or
>    die ("Could not connect to database.");
> 
> All I ever get when I access this page is, "Could not connect to 
> database".  No clue as to why.  Are there, like, LOG FILES anywhere?

Easiest would be to modify your second line there to:

    die("Could not connect to database.  Error was: ".mysql_error());

That should give you a more informative error message when you access
the page.

	-brian

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

iD8DBQFCzdOs6XyW6VEeAnsRAro7AKCMzXL0+BPlF3zxsPirRR6kAmzLqwCeMSIe
5xI8RcuYqFhLQP5MzdfU+ww=
=0Fmv
-----END PGP SIGNATURE-----




More information about the svlug mailing list