--- Ian R-P <[EMAIL PROTECTED]> wrote:

> It just won't connect, i've tried:
>
> $dbcnx = @mysql_connect('localhost','root','XXXXXX') or die('Unable to
> connect ' . mysql_error());
> $dbcnx = @mysql_connect('iansroom','root','XXXXXX') or die('Unable to
> connect ' . mysql_error());
> $dbcnx = @mysql_connect('192.168.2.59','root','XXXXXX') or die('Unable to
> connect ' . mysql_error());
>
> and also without the @ symbol, and everytime without the @ symbol i get this
> error:
>
> *Fatal error*: Call to undefined function mysql_connect() in *
> c:\Inetpub\wwwroot\jokelist.php* on line *12
>
> *line 12 is the $dbcnx = @mysq.... line*
> *

You should banish the @ symbol from your PHP coding for the reasons already cited.  Until your
program is working, you need to see the error messages, not suppress them.

The error message gives you the answer.  Your installation of PHP (obviously on Windows) does not
have the necessary extension to work with MySQL.

If you create a simple text file with a one line PHP statement:

<?php phpinfo(); ?>

and view this page in the browser then you will see the configuration of PHP including the modules
which are available.  If you don't have mysql or mysqli (PHP5) then you don't have a correct
installation for working with the database.

I don't install PHP on Windows and I discourage it among my students.  A Linux/Unix/OS X
installation is much closer to the setup likely used by the web host you will use when you want
your site to be seen by large numbers of people on the Internet.  There are times when PHP on
Windows with Apache or IIS just doesn't behave the same way as it does on *nix.  Some of this has
to do with the available resources and configurations of Windows and PHP installed therein. 

If you must use Windows, the installer from http://www.xampp.org is worth looking at since it
brings in many utilities to make up for what Windows generally lacks.  It's not the best way to go
but it can work for simplistic testing.  However, even doing simple things like sending an email
from a PHP script (a commonly-desired feature) is difficult on Windows because the OS often does
not have an SMTP server.  The xampp installer adds this feature but I don't know if it works "out
of the box."

I'm a little underinformed about PHP on Windows because I don't run Windows at home.  I use it at
work and in my classes because that is what they give me.  I don't attempt to administer it.  I do
hear many problems which students have with the installs, however.  I use Linux and OS X on all of
my home machines and it has worked very well for me.

James
_____


James D. Keeline
http://www.Keeline.com  http://www.Keeline.com/articles
http://Stratemeyer.org  http://www.Keeline.com/TSCollection

http://www.ITeachPHP.com -- Free Computer Classes: Linux, PHP, etc.
Spring Semester January-June 2006.  Two new class topics.


Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list




YAHOO! GROUPS LINKS




Reply via email to