RE: Help in learning PHP and MySQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

from php 5 onwards mysql is not enabled by default

http://www.php.net/manual/en/ref.mysql.php


Note: Windows users will need to enable php_mysql.dll inside of php.ini and
either copy libmysql.dll into the Windows system directory, or make it
available to the PATH.

from memory.......
(To enable it, edit php.ini - find the reference to php_mysql.dll and remove
the ; which comments it out )

Peter




> -----Original Message-----
> From: Novice Learner [mailto:novicelearner@xxxxxxxxx]
> Sent: 31 December 2004 03:35
> To: php-db@xxxxxxxxxxxxx
> Subject:  Help in learning PHP and MySQL
>
>
> I apologize if this is a very basic question.
>
> I just started learing PHP and MySQL, I am reading "PHP and
> MySQL" by Larry Ullman, I also have access to PHP 5 by Julie
> Meloni. I reached Chapter 6 of Ullman's book and got stuck.
>
> I have the following code:
>
> <?php
> //This file contains the database access information. This file
> also establishes a connection
> //to MYSQL and selects the database.
> //Set the database access information as constants
> define ('DB_USER', 'masud');
> define ('DB_PASSWORD', 'masud');
> define ('DB_HOST', 'localhost');
> define ('DB_NAME', 'masud');
> //Make the connection and then select the database
> $dbc = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD);
> mysql_select_db(DB_NAME);
> ?>
>
> I have a normal MySQL user as "masud", whose password is also
> "masud" and a database also called "masud". All this for learning purpose.
>
> I get the following error message:
>
> Fatal error: Call to undefined function mysql_connect() in
> C:\Program Files\Apache
> Group\Apache2\htdocs\CTA\mysql_connect.php on line 13
>
> The books says:
> If you receive an error that claims mysql_connect() is an
> undefined function, it means that PHP has not been compiled with
> MySQL support.
>
> I have been running a test script with <? phpinfo(); ?> and I get
> the results successfully.
>
> I am running Windows XP with Apache 2 server and PHP5 5.0.3
>
> I would appreciate if you could help me in any way, including
> pointing me to resources that can help get going.
>
> Thank you,
>
> Masud
>
>
>
> ---------------------------------
> Do you Yahoo!?
>  Read only the mail you want - Yahoo! Mail SpamGuard.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux