|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| 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. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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! |
|
||||
|
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. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |