| re: Cant connect to database - please help!
I had this program after reinstalling my OS recently. It would appear that
even if you have Apache, PHP and MySQL configured correctly your still
missing the php-mysql module. This is the 'libary' of mysql functions FOR
php if you will.
On my system (Mandrake Linux) the package is called php-mysql-4.3.4-1mdk
I don't know what the windows version is but it's probalby similar.
At least in my case I was getting 'function undefined' because the functions
quite litteraly didn't exist on my system...
Hope that helps.
Ravenslay3r
MJ wrote:
[color=blue]
> I am using the following script to connect but keep getting
> <?php
> $conn = mysql_connect("", "mjohn", "");
> mysql_select_db("testDB",$conn);
> ?>
>
> but keep getting this error
> Fatal error: Call to undefined function mysql_connect() in C:\Program
> Files\Apache Group\Apache2\htdocs\test.php on line 2
>
> if i change line 2 to
> <?php
> $conn = mysqli_connect("", "mjohn", "");
> mysql_select_db("testDB",$conn);
> ?>
> i get this
> Fatal error: Call to undefined function mysql_select_db() in C:\Program
> Files\Apache Group\Apache2\htdocs\test.php on line 3
>
> What am i doing wrong?
>
> Thanks in advance
>
> MJ[/color] |