Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-19-2004, 07:43 AM
WebProWorld New Member
 

Join Date: Jan 2004
Location: Bangladesh
Posts: 23
Informer45 RepRank 0
Default Cannot conect to mysql

IAm using PHP version 5.0.2
and mysql version 4.1
problem is i cannot connect to mysql server.
Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\wwwroot\RMS.php on line 33.

I have used apassword with database now and logged as root
previously i used PHP 4
and mysql 3.2.3 and no password.And it wored.
I could connect ,insert ,update fine.
but now iam facing this problem.

previously this same code worked,but now it doesnt.
I suspect taht i cannot use mysql_connect
but what i should do,i would like some help fast.



<Html>
<Head> An online Banking System</Head>
<body>



<?php


class Bank
{

//var $Relative="/Personal/PHP_PROJ/Pics/JPG";
function Connect( )
{
global $DBUser,$DBPass,$db,$link,$query;

$DBUser="root";
$DBPass="amiga456";
//$db="test";
$link=mysql_connect("localhost",$DBUser,$DBPass);
if(! $link)
die("Could'nt connect to mysql".mysql_error());
mysql_select_db($db,$link)

or die("Could'nt connect to db".mysql_error());





}
function blueFont($font,$text) {
echo "<FONT FACE=\"$font\" COLOR=\"blue\">$text</FONT>";
}







//$BK2=new Bank();




}//end class


$BK=new Bank();
//$BK->menu();
$BK->Connect();
//$BK->Show();

?>
</body>
</Html>
__________________
The impossible doesnot Exist!
Reply With Quote
  #2 (permalink)  
Old 11-19-2004, 09:25 AM
Easywebdev's Avatar
WebProWorld Veteran
 

Join Date: Apr 2004
Posts: 328
Easywebdev RepRank 1
Default

Hi.
PHP5 does not come with the mysql libraries, hence it has no idea what the mysql_connect function is.

You have two choices, go back to php4 or recompile php5 and add "--with-mysql=/path to the mysql libraries" to the configure options.

hth.

[edit] just noticed you are using windows
Take a look at this http://www.faqts.com/knowledge_base/...23162/fid/1150
there are instructions on how to fiddle about with windows dll's (yeuck)[/edit]
__________________
"I have not failed. I have found 10,000 ways that don't work" - Thomas Edison.
"The secret to creativity is knowing how to hide your sources" - Albert Einstein.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , ,



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

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


Search Engine Optimization by vBSEO 3.2.0