View Single Post
Old 02-08-2005, 07:29 PM   #1 (permalink)
plomon
Registered User
 
Join Date: Feb 2005
Posts: 5
plomon is on a distinguished road
Question Cannot connect to mySQL ???

hi there,
I installed phpv5.0.3 and mySQLv4.1 in my system. There is an already configures IIS Server too. I made a php file with the name "test.php" and copied it into the "www" root folder of Inetpub. The following is a php code I wrote :

PHP Code:
<html>
<body>
<?php
$db 
mysql_connect("$localhost""$root","$sqlserver") or die("Invalid server or user.");
mysql_select_db("student",$db);
$sql "INSERT INTO info VALUES ('dilip',20);";
$result mysql_query($sql);
?>
<body>
<html>
In the iexplore address bar, I typed http://localhost/test.php

The file is rightly recognized as a php file and is executing too. But, I get the following error message :

Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\wwwroot\test.php on line 4

mySQL is installed and confiured to localhost with username : root and password : sqlserver.

Please help me !!!
plomon is offline   Reply With Quote