|
Posted by alex.w474 on 01/08/08 08:59
On Jan 3, 8:03 pm, YoLed <inva...@nospam.org> wrote:
> I have to work withPHPand MySQL but I'm new with this environnement.
> So, I've started installing a plateform of mine. So under Windows,Apache, PHP5 and MySQL.
>
> All sounds right when I write a simple .phppage and when I manipulate
> a mysql database(s) at command line.
>
> But, when time commes to write something simple usingPHPand MySQL, I
> get an error :PHPodoesn't seems to recognise a simple instruction like
> mysql_connect.
>
> Here is my code :
>
> a db_config.phpfile containing :
> <?php
> $db_host = "localhost";
> $db_user = "php";
> $db_password = "f00";
> $db_name = "buzzDB";
> ?>
>
> a temp_con.phpfile containing :
> <?php
> require($_SERVER["DOCUMENT_ROOT"]."/mysql_test/db_config.php");
> $connection = mysql_connect($db_host, $db_user, $db_password) or die
> ("error connecting");
> echo "connection made";
> ?>
>
> And when I launch temp_con.phpin the framework of the local webserver
> (sayhttp://dev-server/mysql_test/temp_con.php), I got this error
> message in the web browser :
>
> "Fatal error: Call to undefined function mysql_connect() in Y:\4Apache
> \vhosts\dev\htdocs\mysql_test\temp_con.phpon line 3"
>
> What's happens ? What should I do ? Is there something missing in thePHPconfig to be able to use MySQL commands ?
Consider http://www.witsuite.com - Apache, PHP, MySQL installer and
configurator, for Windows. It is simple and efficient (installation
demo: http://www.witsuite.com/products/installer/). If you prefer to
install packages manually, you can use the instruction at
http://www.witsuite.com/support/knowledge-base/manual-installation/install-php.php.
Navigation:
[Reply to this message]
|