Reply to Re: Problem with connecting to MySQL from PHP script

Your name:

Reply:


Posted by Sky8000 on 08/24/05 14:00

Hi,

You need mysql libs for PHP (which are 2 dll) and you need to modify php.ini
to activate the extension for mysql support.

Sky8000


"J D" <webmaster@naughtysabrina.com> wrote in message
news:dc842d$6br$1@ss405.t-com.hr...
> Hi!
>
> I have one problem and I'm hoping that someone can help me. I'm writing
> PHP
> script and wish to connect to MySQL database from PHP script but I can't,
> always get error message like this:
>
> Fatal error: Call to undefined function mysql_connect() in C:\Program
> Files\Apache Group\Apache2\htdocs\CMS3\install\connect.php on line 10
>
> My script looks like this:
>
> <?php
> $database="cmsdbase";
> $mysql_user = "root";
> $mysql_password = "loz001";
> $mysql_host = "localhost";
> $mysql_table_prefix = "";
>
>
>
> $success = mysql_pconnect($mysql_host, $mysql_user, $mysql_password);
> if (!$success)
> die ("<b>Cannot connect to database, check if username, password and host
> are correct.</b>");
> $success = mysql_select_db($database);
> if (!$success) {
> print "<b>Cannot choose database, check if database name is correct.";
> die();
> }
> ?>
>
> I tried to use mysql_connect() but result is the same error message. Btw,
> I'm using MySQL Server 4.1 and PHP 5.0.4.
>
> Can anyone help me? Thanks!
>
>
>
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация