Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 02-08-2005, 06: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
Old 02-08-2005, 09:25 PM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
it doesn't look like it was compiled with the mysql functions. you have 2 options.

option #1: ( the easiest ) un-install php 5, and install php 4.3.10

option #2: ( not sure if this is it ) find your php.ini file , probably c:\windows\php.ini, and make sure the mysql libraries are un-commented. if that line was commented, then un-comment and re-start your web server.

i'd go with #1 if i were you.
__________________
Mike
sde is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Replication / Failover idx Everything SQL ( MySQL, MSSQL, DB2, Postgre, Oracle, etc...) 2 02-23-2005 07:22 PM
MySql connect error message slappy Everything SQL ( MySQL, MSSQL, DB2, Postgre, Oracle, etc...) 2 08-23-2004 07:02 PM
cant connect to mysql databases using php eran PHP 11 08-07-2004 08:02 AM
and on to mysql .. sde Linux / BSD / OS X 2 01-18-2003 07:39 PM


All times are GMT -8. The time now is 04:33 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting